Tearing my hair out on this one.
I have an internal Win2008 server running IIS7.0 and PHP 5.2.4. The email server is on a seperate server on the same network.
I can use php's mail function to send emails with no issues but when I use PHPMailerLite, I get the message "could not instantiate mail function".
I have researched a lot and tried the following but still no joy.
- SetFrom - changed this to an existing email address on the mail server.
- Verified SMTP settings in php.ini
- Tested php's mail function directly and emails send no problem.
- Downloaded PHPMailer again in case of corruption.
Any help would be appreciated.....
Alan
Just to add, the default examples included with PHPMailer doesn't work either, same error. This code is working on other test servers for me.
$mail = new PHPMailerLite();
$mail->IsMail(); // telling the class to use PHP Mail to send email
$mail->SetFrom("[email protected]","CareSys");
$mail->AddReplyTo("[email protected]","CareSys");
$mail->Subject = "Weekly Planner";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$mail->AddAddress($email_add, $carer_name);
$mail->AddAttachment('../../temp/carer_planner.pdf','carer_planner.pdf'); // attachment
$mail->ConfirmReadingTo = '[email protected]';
if(!$mail->Send()) { $error_count=1; }
if ($error_count<1) { echo 'Email Sent Successfully'; }
If I put the recipient address directly in the class file on line 582 instead of the $to vairable, it works. But using $mail->AddAddress($email_add, $carer_name) will not even if I replace the $email_add variable with the receipient address.