Ok, I'm pretty much willing to try anything at the moment just so I can send an email using php, so I've:
- downloaded phpmailer
- put the contents of the zip into a folder on my public web directory
- copied class.phpmailer.php, class.smtp.php, phpmailer.lang-en.php into my php includes folder
- uncommented the includes path in php.ini
And now I'm trying to use the example they've given in the readme file:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "192.168.1.68;192.168.1.68"; // specify main and backup server
//$mail->SMTPAuth = true; // turn on SMTP authentication
//$mail->Username = "jswan"; // SMTP username
//$mail->Password = "secret"; // SMTP password
$mail->From = "from@example.com";
$mail->FromName = "Mailer";
$mail->AddAddress("myemailaddress@hotmail.com");
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
At the moment, I'm unsure about the SMTP username and password - I simply don't remember being ask to set them - would I have had to set these when installing smtp from windows server 2003? Or are they the same as my windows login details? Or do I even have to set them?
The error messages I'm currently getting are:
Message could not be sent
Mailer Error: Language string failed to load: recipients_failed myemailaddress@hotmail.com
Could you tell me how you managed to get phpmailer working on your windows install?
Thanks.