How to send email using PHP script and check it

Refers to:

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

Created:

2016-11-16 13:20:58 UTC

Modified:

2017-02-14 03:00:03 UTC

4

Was this article helpful?


Have more questions?

Submit a request

How to send email using PHP script and check it

Question

How to send email using PHP script and check it?

Answer

  1. Open domain directory %plesk_vhosts%\\example.com\\httpdocs
  2. Create simple PHP file ( mail.php, for example) with content as below:

    <?php
    // Send email
    mail("test@example.com","hello","test mail function");
    ?>

    Note: test@example.com can be changed to any email address.

  3. Make sure that PHP is enabled on domain under Plesk > Domains > example.com > Hosting settings > PHP

  4. Try to browse the mentioned PHP page in Internet Browser: http://example.com/mail.php

Have more questions? Submit a request
Please sign in to leave a comment.