Unable to send email using php scripts via Browser

Follow

Comments

6 comments

  • Avatar
    Bhartendu Vimal

    Thanks for this information.Sending Mail in PHP Using PHP Scripts is one of the very good ways where you can send multiple emails through PHP scripts. Thanks for this information.

  • Avatar
    Michael S.

    Hello,

    if i set PHP Handler to FAST CGI http://prntscr.com/myb2a9

    i can not send any email vie mail() function. It returns always error.

    /var/log/mail.err

    Mar 15 14:54:10 h2825876 plesk sendmail[6934]: _mh_fork(): Error occured during fork(): Resource temporarily unavailable
    Mar 15 14:54:10 h2825876 plesk sendmail[6934]: Error during 'check-quota' handler
    Mar 15 14:54:10 h2825876 plesk sendmail[6936]: my_popen(): fork() failed: Resource temporarily unavailable [11]
    Mar 15 14:54:10 h2825876 plesk sendmail[6936]: Unable to execute MTA

    How to fix this bug?

    With PHP-FPM it works!

    Thanks!

     

     

  • Avatar
    Michael S.

    >Plesk > Tools & Settings > Mail Server Settings 

    >Plesk > Subscriptions > example.com > Change Outgoing Mail Limits

     

    Please show on screenshots how it must be there enabled?

    I have nothning about sendmail there.

  • Avatar
    Alisa Kasyanova

    @Michael M.
    I have added te screenshots to the article, hope it may the article more informative.
    As for the GastCGI issue, if you are using SELinux, check the following article: https://support.plesk.com/hc/en-us/articles/213361389-Cannot-send-email-using-PHP-mail-function-Unable-to-rename-usr-local-psa-handlers-spool-messageXXX-file-Permission-denied

  • Avatar
    William Dugger (Edited )

    Followed article but still no email can be sent using php.  Doesn't even show in the mail queue.

  • Avatar
    Nikita Nikushkin

    Hi @William Dugger,

    Maybe the issue is related to the PHP script itself?

    In order to check it, perform the next actions:

    1. Create a file under the domain home directory with the following content:

    <?php
    mail('johndoe@example.com','hello','test mail function');
    ?>

    2. Make sure that PHP support is enabled for the domain at the "Plesk > Domains > example.com > PHP Settings" page

    3. Try to open the PHP script via a browser:

    https://example.com/testfile.php

    If the issue still occurs without any info in logs, it is better to create a request to Plesk Support for further issue investigation

Please sign in to leave a comment.

Have more questions? Submit a request