Once you have PHPMailer setup I found out through trial and error this worked the best for me (if you’re running a local server to test out your scripts).
[php] if (filter_input(INPUT_SERVER, ‘SERVER_NAME’, FILTER_SANITIZE_URL) == “localhost”) {
$mail->isSmtp(); // Local Host:
$mail->Port = EMAIL_PORT; // Local Host Port: (Usually 587)
} else {
$mail->isSendMail(); // Remote Host:
}[/php]
A little background story about this part of the script, I notice one day that my remote server wasn’t sending out emails from my contact page or registration page. So after Googling, I found out that most remote email servers prefer $mail->isSendMail over $mail->isSmtp(). Hopefully this will prevent you some headaches.