I’m having and an issue with php mailer script. Using mamp the script works, but on the server I get an error (I’ve omitted sensitive info).
“Invalid address: [valid email] Mailer Error: You must
provide at least one recipient email address.”
Heres my code:
require_once("includes/phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = "smtp.emailsrvr.com";
$mail->SMTPDebug = 2;
$mail->Port = 25;
$mail->Username = "test@test.com";
$mail->Password = "test";
$mail->Subject = "Subject";
$mail->SetFrom($_POST['email'], $_POST['name']);
$mail->AddReplyTo($_POST['email'], $_POST['name']);
$address = "test@test.com";
$mail->AddAddress($address, "name");
$body = "<p>test</p>";
$mail->MsgHTML($body);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
If it helps, I am using the rackspace email apps.
Im not very savy with php or server setups unfortunately so if anyone can help that would be great!
So i had no luck here, but I now know the issue stems from server mail settings rather then the script.
In the end I just went to using postmark.