I use PHPMailer to send mail through GMail. The code I use is straight from the tutorial and it works fine on my laptop. However, testing this on a Windows 2003 Server - it always seems to return an SMPT error:
SMTP Error: Failed to connect to the SMTP host. Mailer error: SMTP error: it is possible not to connect to the SMTP host.
Here are the settings I use in PHPMailer:
include("phpmailer/class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // use ssl $mail->Host = "smtp.gmail.com"; // GMAIL SMTP server $mail->Port = 465; // SMTP port used by GMAIL server
Can I say with confidence that this is not a port problem, since I connect to another server on port 465 and send mail. If not, explain.
How can I solve this problem?
Thank you all for your help.
source share