douliu1092 2019-08-14 11:37
浏览 1305

通过godaddy SMTP发送电子邮件的正确设置是什么?

I am using GoDaddy Professional Email (NOT Workspace Email) under Email & Office. For my website, I want to email users using PHPMailer. I have used all the credentials according to GoDaddy Email Server infos.

According to GoDaddy, the outgoing server settings are:

  • SMTP Host : 'smtpout.secureserver.net'
  • Port: 465
  • Security : 'ssl'

I have set my PHPMailer code as follows:

<?php

try
{
    $email = new PHPMailer(TRUE);
    $email->isSMTP();
    $email->SMTPDebug = 2;
    $email->SMTPAuth = TRUE;
    $email->SMTPAutoTLS = FALSE;
    $email->SMTPSecure = "ssl";
    $email->Host = "smtpout.secureserver.net";
    $email->Port = 465;
    $email->Username = "myUserName";
    $email->Password = "MyPassword";

    $email->setFrom("address@from.com", "Name");
    $email->addAddress("address@to.com", "Name");
    $email->isHTML(TRUE);
    $email->Body = "My HTML Code";
    $email->Subject = "My Subject";
    $email->send();
}
catch (Exception $e)
{
    // $email->ErrorInfo;
}

?>

The above code throwing following error:

2019-08-14 10:55:58 SMTP ERROR: Failed to connect to server: Connection refused (111) SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

I have searched for solutions. Some Stackoverflow questions discuss about GoDaddy Workspace Email. But I am frustrated to find a solution till now. Please help me if I am doing anything wrong.

  • 写回答

2条回答 默认 最新

  • 奥尔良香脆 2020-04-30 17:55
    关注

    都接近放弃换主机了,用了大神的代码成功了,无比激动来评论一下。GoDaddy真的垃圾,打电话给他们主机也是忽悠忽悠就过了,根本就实现不了

    评论

报告相同问题?

悬赏问题

  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名