PHPMailer: Using remote SMTP server, works under localhost, Connection refused (111) on remote server

混江龙づ霸主 提交于 2019-12-05 15:51:00

I think you should perform two step 1) check your port as suggested on godaddy support http://support.godaddy.com/help/article/319/what-do-i-do-if-i-have-trouble-connecting-to-my-email-account 2)use "relay-hosting.secureserver.net" as your host instead of "smtpout.secureserver.net"

GoDaddy does allow to send emails using Gmail as your SMTP, just need to get rid of the smtp.gmail.com and use their Host instead. This is my setup:

$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = "relay-hosting.secureserver.net";
$mail->Username = "your-account@gmail.com";
$mail->Password = "yourpassword";
// ...
// send from, send to, body, etc...

Reference (see first two posts) http://support.godaddy.com/groups/web-hosting/forum/topic/phpmailer-with-godaddy-smtp-email-server-script-working/

If your hosting has own email server, the server will use the following ports 25,465,587. Settings for GoDaddy:

$mail->isSMTP(); 
$mail->Host = localhost; 
$mail->SMTPAuth = true;
$mail->Username = 'example@gmail.com';
$mail->Password = 'password';

//$mail->SMTPSecure = 'tls'; 
//$mail->Port = 587;

For other providers you have to create a mailbox with your domain:

$mail->isSMTP(); 
$mail->Host = localhost; 
$mail->SMTPAuth = true;
$mail->Username = 'example@yourdomain.com';
$mail->Password = 'password';

//$mail->SMTPSecure = 'tls'; 
//$mail->Port = 587;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!