PHP mail function does not work

Created:

2016-11-16 13:21:32 UTC

Modified:

2017-04-24 11:15:36 UTC

3

Was this article helpful?


Have more questions?

Submit a request

PHP mail function does not work

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.5 for Windows
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows

Symptoms

PHP mail function does not work. I have php script that sends emails, but it does not work. In mail logs I got the following error:

    MAIL    MAIL FROM:<@adminemail@> SIZE=359   555 5.5.2 Syntax error.

OR

Following information can be found in MailEnable SMTP-Activity log:

06/06/16 16:17:33   SMTP-IN F4263D896EF14A7EA44A0DB04E4D55FE.MAI    956 127.0.0.1   MAIL    MAIL FROM:<@adminemail@>    250 Requested mail action okay, completed   43  26

Resolution

  1. Check what PHP version is used by domain:

    Plesk Control panel->domains->domain.com->hosting settings->PHP
  2. Open PHP installation directory: C:\Program Files (x86)\Parallels\Plesk\Additional\PHPx where PHPx is installation directory of certain PHP version.

  3. Open php.ini and find this lines:

    [mail function]
    SMTP = localhost
    smtp_port = 25

    sendmail_from = @adminemail@
  4. Correct sendmail_from to valid email address like:

    sendmail_from = email@domain.tld
Have more questions? Submit a request
Please sign in to leave a comment.