<?php
require_once('PHPMailer/class.phpmailer.php');
$mailer = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mailer->IsSMTP(); // telling the class to use SMTP
try {
$mailer->Host = "mail.test.nl"; // SMTP server
$mailer->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mailer->SMTPAuth = true; // enable SMTP authentication
$mailer->Port = 25; // set the SMTP port for the GMAIL server
$mailer->Username = "[email protected]"; // SMTP account username
$mailer->Password = "testtest"; // SMTP account password
$mailer->AddAddress('[email protected]', Ttest Test');
//$mailer->AddAddress('[email protected]', 'Test2 Test2');
$mailer->SetFrom('[email protected]', 'Test123');
$mailer->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mailer->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mailer->MsgHTML(file_get_contents('contents.html'));
$mailer->Send();
echo "Message Sent OK<p></p>\n";
}
catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
}
catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
Zoals je ziet staat het tweede TO address in de comment. In deze situatie komt mijn mail simpelweg NIET aan op het hotmail adres.
Wanneer ik het tweede (niet hotmail adres) uit het commentaar haal en de mail dus naar twee mail adressen gaat dan komt deze zowel op het hotmail als op het tweede mail adres aan.
Wanneer ik het hotmail adres in de comment zet en het andere adres laat staan, komt de mail hier ook gewoon aan.
De volgorde maakt overigens niet uit (dit heb ik al geprobeerd). Ook wanneer ik 2 x een (verschillend) hotmail adres er in zet, werkt het niet.
Iemand enig idee wat ik over het hoofd zie waardoor ik niet gewoon naar alleen hotmail adressen kan mailen?