longtone Posted October 23, 2009 Share Posted October 23, 2009 I am trying to use phpMailer with smtp: $mailer = new PHPMailer(); $mailer->IsSMTP(); $mailer->Mailer = "smtp"; $mailer->SMTPSecure = 'tls'; $mailer->Host = 'smtp.orangehome.co.uk'; $mailer->Port = 25; $mailer->SMTPAuth = false; $mailer->Username = 'mail@domain.com'; $mailer->Password = 'password'; $mailer->From = 'mail@domain.com'; $mailer->FromName = 'Me'; $mailer->Body = 'This is the main body of the email'; $mailer->Subject = 'This is the subject of the email'; $mailer->AddAddress('you@domain.com'); if(!$mailer->Send()) { echo "Message was not sent<br/ >"; echo "Mailer Error: " . $mailer->ErrorInfo; } else { echo "Message has been sent"; } I have also tried with googlemail: $mailer = new PHPMailer(); $mailer->IsSMTP(); $mailer->Mailer = "smtp"; $mailer->SMTPSecure = 'ssl'; $mailer->Host = 'smtp.gmail.com'; $mailer->Port = 465; $mailer->SMTPAuth = TRUE; $mailer->Username = 'mail@domain.com'; $mailer->Password = 'password'; $mailer->From = 'mail@domain.com'; $mailer->FromName = 'Me'; $mailer->Body = 'This is the main body of the email'; $mailer->Subject = 'This is the subject of the email'; $mailer->AddAddress('you@domain.com'); if(!$mailer->Send()) { echo "Message was not sent<br/ >"; echo "Mailer Error: " . $mailer->ErrorInfo; } else { echo "Message has been sent"; } but I get this error message: Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.orangehome.co.uk:25 (Connection timed out) ... or the equivalent for gmail Is there something I'm missing? PHP Version 5.2.6 PHPMailer - PHP email class Version: 2.3 Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted October 23, 2009 Share Posted October 23, 2009 looking at a few forums it looks like orange smtp is ip restricted. It won't allow you to do authentication. If the google mail server will allow you to use a port other than 25 that would be the way to go. Quote Link to comment Share on other sites More sharing options...
longtone Posted October 24, 2009 Author Share Posted October 24, 2009 Thanks Google is the one I'd prefer to use. And their documentation does say port 465. Should I assume I'm using phpMailer correctly, and the problem is with Google? Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted October 24, 2009 Share Posted October 24, 2009 go here http://www.canyouseeme.org/ and see if port 465 is blocked. If it's not blocked it might be because you're trying to use SSL Quote Link to comment Share on other sites More sharing options...
longtone Posted October 24, 2009 Author Share Posted October 24, 2009 Doesn't that just test the ports on the ISP I happen to be using? I couldn't see anywhere to enter gmail's IP. Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted October 24, 2009 Share Posted October 24, 2009 I gave you the wrong link. Here's the right one. http://webtools.live2support.com/nt_cport.php Quote Link to comment Share on other sites More sharing options...
longtone Posted October 30, 2009 Author Share Posted October 30, 2009 That makes more sense And that was the problem I contacted the hosting company, he opened the port, and away we go. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.