How to Configure mb_language() and mb_send_mail()

Asked 2 years ago, Updated 2 years ago, 77 views

Thank you for your continuous support.
◆What you want to do
I would like to set up a mail server (postfix) on centos7 and send mail from PHP source.

◆What I'm into now
// test_mail.php

Enter the code here
<?php
 $mail="[email protected]";
 $subject="This is a test email";
 $body="This is the body";
 mb_language("Japanese");
 $ret=mb_send_mail($mail,$subject,$body);
 var_dump($ret);

Executed the code

Enter the code here
PHP Fatal error: Call to undefined function mb_language() in 
/root/mail_test.php on line 5

The error occurred.
Comment out this part and do more.

Enter the code here
PHP Fatal error: Call to undefined function mb_send_mail()in 
/root/mail_test.php on line 6

I get an error.As the title suggests, mb_language() and mb_send_mail() cannot be configured.

◆ What you did
①PHP Fatal error: Call to undefined function mb_language() in/root/mail_test.php on line 5
I tried installing yum-y install php_mbstring on the .

PH PHP Fatal error: Call to undefined function mb_send_mail() in/root/mail_test.php on line 6
tried to see if it was commented out in the php.ini configuration, but it was not commented out.
Thank you for your cooperation.

php centos

2022-09-30 19:49

1 Answers

mb_language,mb_send is a function available after php-mbstring is installed.

For centos, you can install the following:

#yum install php-mbstring

You should also check if the php.ini file has mbstring settings.


2022-09-30 19:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.