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:
$mail = new PHPMailer();
$mail->Host = “smtp.mydomain.io”;
$mail->SMTPAuth = true;
$mail->Username = "firstname.lastname@example.org";
$mail->Password = “mypassword”;
$mail->From = "email@example.com";
$mail->FromName = “My Site Name”;
$mail->AddReplyTo("firstname.lastname@example.org", “No Reply”);
$mail->Subject = $subject;
$mail->Body = $message;
echo "Message could not be sent.
echo "Mailer Error: " . $mail->ErrorInfo;
echo “Message has been sent”;
Any idea how to get this to work?