通过Godaddy SMTP发送电子邮件的正确设置是什么? [英] What is correct settings for sending email through godaddy SMTP?
问题描述
我正在使用电子邮件&办公室.对于我的网站,我想使用PHPMailer向用户发送电子邮件.我已经根据GoDaddy电子邮件服务器的信息使用了所有凭据.
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.
根据GoDaddy,传出服务器设置为:
According to GoDaddy, the outgoing server settings are:
- SMTP主机:'smtpout.secureserver.net'
- 端口:465
- 安全性:"ssl"
我将我的PHPMailer代码设置如下:
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错误:无法连接到服务器:连接被拒绝(111)SMTP connect()失败.https://github.com/PHPMailer/PHPMailer/wiki/疑难解答
我正在寻找解决方案.一些Stackoverflow问题讨论了有关GoDaddy Workspace电子邮件的信息.但直到现在,我都对找到解决方案感到沮丧.如果我做错了任何事情,请帮助我.
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.
推荐答案
我发现以下设置有效.这可能有用.
I have found the following setting working. This may be useful.
使用80作为端口
<?php
try
{
$email = new PHPMailer(TRUE);
$email->isSMTP();
$email->SMTPDebug = 2;
$email->SMTPAuth = TRUE;
$email->SMTPAutoTLS = FALSE;
$email->SMTPSecure = "tls";
$email->Host = "smtpout.secureserver.net";
$email->Port = 80;
$email->Username = "GoDaddy Professional Email Username";
$email->Password = "GoDaddy Professional Email Password";
$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;
}
?>`
这篇关于通过Godaddy SMTP发送电子邮件的正确设置是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!