This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
faq:troubleshooting-could-not-instantiate-mail-function [2014/02/27 10:38] Alia |
faq:troubleshooting-could-not-instantiate-mail-function [2014/02/27 11:18] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Troubleshooting "Could not instantiate mail function" ====== | ====== Troubleshooting "Could not instantiate mail function" ====== | ||
- | Full error message: | + | Full error message: |
<code php> | <code php> | ||
OW Debug - Exception | OW Debug - Exception | ||
Message: Could not instantiate mail function. | Message: Could not instantiate mail function. | ||
- | File: /var/www/friendly/data/www/friendly.ru/ow_libraries/php_mailer/class.phpmailer.php | + | File: /mysitename/ow_libraries/php_mailer/class.phpmailer.php |
Line: 595 | Line: 595 | ||
Trace: | Trace: | ||
Line 23: | Line 23: | ||
Human readable explanation of the error message: phpMailer library tried to send a message using the php mail() function and the php mail() function returned "false" result. | Human readable explanation of the error message: phpMailer library tried to send a message using the php mail() function and the php mail() function returned "false" result. | ||
- | Two most common causes of this error message are | + | Two most common causes of this error message are: |
- | - server settings | + | - Server settings |
- | - phpmailer library used within Oxwall. | + | - Phpmailer library used within Oxwall. |
===== Checking Server Settings ===== | ===== Checking Server Settings ===== | ||
Line 37: | Line 37: | ||
<code php> <?php $to = 'recepient@example.com'; $subject = 'Test email using PHP'; $message = 'This is a test email message'; $headers = 'From: any_sender_email@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers, '-fany_sender_email@example.com'); ?> </code> | <code php> <?php $to = 'recepient@example.com'; $subject = 'Test email using PHP'; $message = 'This is a test email message'; $headers = 'From: any_sender_email@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers, '-fany_sender_email@example.com'); ?> </code> | ||
- | |||
Where | Where | ||
* any_sender_email@example.com - your sender's email | * any_sender_email@example.com - your sender's email | ||
Line 54: | Line 53: | ||
Check the email you have set for "recepient@example.com". | Check the email you have set for "recepient@example.com". | ||
- | If you don't receive testing email, then php mail script is not working: | + | If you don't receive testing email, contact your hosting provider and check: |
- | - Check whether phpmailer library is installed/enabled/configured on your server | + | - whether phpmailer library is installed/enabled/configured on your server. |
- | - Check whether php mail() function is installed/enabled/configured on your server | + | - whether php mail() function is installed/enabled/configured on your server. |
- | Best way to check this, is to contact your hosting provider. | + | |
- | If you receive testing email, php mail script is working on your server. In this case, "Could not instantiate mail function" is most likely to be caused by php mailer libraries used in Oxwall. | + | If you receive testing email, php mail script is working on your server. In this case, "Could not instantiate mail function" is most likely to be caused by php mailer libraries used in Oxwall itself. |
===== Phpmailer libraries used within Oxwall ===== | ===== Phpmailer libraries used within Oxwall ===== | ||
- | If your have tried all the steps listed above, have contacted your hosting provider and are still getting "Could not Instantiate Mail Function" then phpmailer libraries used in Oxwall might not be compatible with your server's configuration. | + | If you have tried all the steps listed above and are still getting "Could not Instantiate Mail Function" then phpmailer libraries used in Oxwall might not be compatible with your server's configuration. |
Open ow_libraries/php_mailer/class.phpmailer.php and find line #571: | Open ow_libraries/php_mailer/class.phpmailer.php and find line #571: |