Hi. I am working on a site through which users can send each other secret emails. Unfortunately, when I use the regular php mail() function, while the emails send, they don’t make it to gmail users. I believe that gmail has blacklisted my server because it thinks they are spam. (They aren’t. The users send the emails themselves.) After reading some posts here on the subject, I have decided to try to use phpmailer and smtp instead. However, I don’t know how to set up smtp for my dreamhost domain. Here is my current code:
[php]
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = “smtp.mydomain.io”;
$mail->SMTPAuth = true;
$mail->Username = "mailer@mydomain.io";
$mail->Password = “mypassword”;
$mail->From = "mailer@mydomain.io";
$mail->FromName = “My Site Name”;
$mail->AddAddress($recipient);
$mail->AddReplyTo("noreply@mydomain.io", “No Reply”);
$mail->IsHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
if(!$mail->Send())
{
echo "Message could not be sent.
";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo “Message has been sent”;
[/php]
Any idea how to get this to work?