Test your sendmail functionality from within PHP
Some people have reported problems with sending mail from PHP.
This appears to be particularly prevalent on Windows servers but also on some Linux and other Unix servers.
The attached scripts are small PHP programs you can install on your web server to test whether it can send email from PHP (and whether you actually receive the mail).
Here’s what to do:
- Download testmail.php.
- Edit it and enter your own email address where the script tells you.
- Upload it to your web server (call it “testmail.php”).
- Open the script with your web browser.
- If it tells you the mail function failed OR you don’t receive the test message,
- repeat the above steps with testmail2.php. If neither work, you can contact your hosting provider and ask them why these simple scripts don’t work.
If testmail.php doesn’t work but testmail2.php does work, you’ll need to set SENDMAIL_F_OPTION to “true” in formmail.php. In the configuration section look for:
PHP Code:
define("SENDMAIL_F_OPTION",false);
and change it to:
PHP Code:
define(“SENDMAIL_F_OPTION”,true);
(You need FormMail version 4.09 or later to use the SENDMAIL_F_OPTION feature.)
If you have version 7.11 or later then set SET_SENDER_FROM_EMAIL to “true” too. Look for:
PHP Code:
define("SET_SENDER_FROM_EMAIL",false);
and change it to:
PHP Code:
define("SET_SENDER_FROM_EMAIL",true);
Download –> [download id=”1″]