Recently I've tried to use your (excellent) script on a shared hosting environment different than the one I normally use.
Each time, I encounter the same error message, namely:
"Error: it was not possible to send e-mail message"
I suspected there might be a problem with the PHP mail() function on this hosting, but then I tried this small script with success:
$hostname = "domainname.com";
$from = "firstname.lastname@example.org";
$to = "email@example.com";
$subject = "Test script from $hostname";
$message = "This is a message body for your e-mail";
mail($to,$subject,$message,$from) or die("Mail failed.");
die("Mail sent $from to $to");
As you can see here http://www.work4stars.com/test_email_message.php, the test script from the MIME package also throws the error above.
Please find information on my PHP settings here: http://www.work4stars.com/info.php
Could you please have a look what might be the problem here? I've never encountered this error on any of the other hosting environments I've used thusfar.
Manuel Lemos - 2012-03-11 05:35:08 - In reply to message 7 from Maarten Machiels
If you have PHP error log enabled and the mail function fails you are able to know what is the error by looking at the error log.
Also if you have the option track_errors is set in php.ini or otherwise set it using ini_set('track_errors', 1); before calling the class Send() function, it will be able to return a more complete error message by using the $php_errormsg variable.