Topic on Project:Support desk

[RESOLVED] PHP mail()

12
114.66.4.217 (talkcontribs)

Hello, when I established my wiki, I met a problem that when I creat a new user and input my email account, it will shows that: 邮件发送器的返回信息:在 PHP 的 mail() 函数中的未知错误 which means that there are some unknown errors in PHP mail() function. Did you meet the same problem? Please give me some help! Thanks a lot.

Ciencia Al Poder (talkcontribs)

Take a look at Manual:$wgSMTP and see if you've configured it correctly.

114.66.4.217 (talkcontribs)

Hello again!Thanks for your help and I checked code about SMTP as following: /**

* SMTP Mode.
*
* For using a direct (authenticated) SMTP server connection.
* Default to false or fill an array :
*
* @code
* $wgSMTP = array(
*     'host'     => 'SMTP domain',
*     'IDHost'   => 'domain for MessageID',
*     'port'     => '25',
*     'auth'     => [true|false],
*     'username' => [SMTP username],
*     'password' => [SMTP password],
* );
* @endcode
*/

$wgSMTP = false;

This is the code about SMTP in DefaulingSettings and does it mean that the service of SMTP was not used?

And I checked errorlog, there was an error that:sh: 1: /usr/bin/sendmail: not found

I was really confused due to my limited knowledge ;(

Ciencia Al Poder (talkcontribs)

DefaultSettings.php is a file containing the default settings for MediaWiki. You must not change that file, but modify the value of the variables you want in LocalSettings.php instead.

You may need to set up $wgSMTP depending on your scenario, specially if your mail server needs authentication for sending mails.

114.66.4.217 (talkcontribs)

Thank you for your kind reply! I fixed that error finally! The wrong thing was that I added a sentence as

$wgSMTP = true;

114.66.4.217 (talkcontribs)

Thank you for your kind reply! I fixed that error finally! The wrong thing was that I added a sentence as

$wgSMTP = true;

AKlapper (WMF) (talkcontribs)

Hi, I recommend to take a look at Manual:How_to_debug and provide very basic information, like PHP and MediaWiki version, plus finding out how to get way better debug information for PHP's mail issues.

114.66.4.217 (talkcontribs)

Thanks for your kind help! I checked errorlog ,and found out the error message that sh: 1: /usr/bin/sendmail: not found

Any help will really help me! Thanks a lot again!:)

AKlapper (WMF) (talkcontribs)

If "/usr/bin/sendmail" is "not found" you might want to install it?

114.66.4.217 (talkcontribs)

Would you mind to give me some advice to install it? I copied sendmail.php from php/lib/php/Mail to /usr/bin/sendmail, but it still did not work...not found again...T-T

Ciencia Al Poder (talkcontribs)

Use the packet manager of your linux distribution: apt, yum, zypper...

AKlapper (WMF) (talkcontribs)

Assuming this is a Unix/Linux based system (due to /usr/bin/), how would you install any other application on your system? The same way you install Sendmail... Cannot give better instructions as I know nothing about your system.

Reply to "[RESOLVED] PHP mail()"