I am writing the Mail Module in my project and decide to use phpmailer to send the test email to my gmail account. However, I end up with the following error msg.
SMTP server error: "Your IP: 221.253.178.1 : Your domain myserver.com is not allowed in 550 header From"
My codes are as follow:
<?php
require_once('phpMailer/class.phpmailer.php');
$mail = new PHPMailer(); // defaults to using php "mail()"
$body = "Hello World";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "mail.myserver.com"; // sets SMTP server
$mail->Username = "ttcg+myserver.com"; // username
$mail->Password = "xxxxx"; // password
$mail->Port = 26; // sets PORT
$mail->SetFrom('[email protected]', 'ttcg');
$address = "[email protected]";
$mail->AddAddress($address, "TTCG");
$mail->Subject = "PHPMailer Test Subject via mail(), basic";
$mail->MsgHTML($body);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
Can someone help me with this? Thanks.