I want to send mail through PHP, so i am using PHPMailer. Don't know why i am getting this error.
Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Relaying not allowed - sender domain not local SMTP code: 530
This is my code.
require '../library/PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->IsSMTP(); //From email address and name $mail->From = "my@email.address"; $mail->FromName = "Full Name"; //To address and name $mail->addAddress("my@email.address", "Recipient Name"); //$mail->addAddress("recepient1@example.com"); //Recipient name is optional //Address to which recipient will reply $mail->addReplyTo("p.archish@live.com", "Reply"); //Send HTML or Plain Text email $mail->isHTML(true); $mail->Subject = "Subject Text"; $mail->Body = "<i>Mail body in HTML</i>"; //$mail->AltBody = "This is the plain text version of the email content"; if(!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent successfully"; }
Any help or suggestion? and i am not executing this code on local, it's on server.