沃梦达 / 编程问答 / php问题 / 正文

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题

Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

本文介绍了关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经研究了 3 周来研究如何使用 PHPMailer 为 GoDaddy 配置 SMTP,但没有一个有效.尝试联系 GoDaddy 支持,但他们尚未回复.而且我还没有看到任何关于如何在他们的服务器上设置 SMTP 的文档.

I've been researching for 3 weeks now on how to configure SMTP using PHPMailer for GoDaddy but none of it works. Tried contacting the GoDaddy support but they haven't replied yet. And I haven't seen any documentation on how to setup SMTP on their server.

我已经多次更改主机,测试了它们,但都没有成功发送电子邮件.我超越了错误(使用 PHPMailer 调试),但是当我检查电子邮件时,我看不到任何收到的消息.

I've been changing the Host many times, tested them, but none of it were successful in sending the email. I surpassed the error (using PHPMailer debug) but when I checked the email, I couldn't see any messages being received.

这些是我尝试过的主机:

These are the hosts I've tried:

$mail->Host = "smtp.office365.com";
$mail->Host = "smtpout.secureserver.net";
$mail->Host = "relay-hosting.secureserver.net";
$mail->Host = "localhost";

另外,我已经尝试了PHPMailer故障排除中的设置,但它不起作用.

Also, I've tried the settings in PHPMailer troubleshooting, but it won't work.

$mail->isSMTP();
$mail->Host = 'relay-hosting.secureserver.net';
$mail->Port = 25;
$mail->SMTPAuth = false;
$mail->SMTPSecure = false;

我目前的设置是:

$mail->isSMTP();
$mail->Host = "smtpout.secureserver.net";
$mail->Port = 80;
$mail->SMTPAuth = true;

//Enable SMTP debugging. 
$mail->SMTPDebug = 4;

//Provide username and password     
$mail->Username = "email@email.com";                 
$mail->Password = "password"; 

$mail->From = "email@email.com";
$mail->FromName = "From Name";

$mail->addAddress("email@email.com", "Name");

使用的电子邮件是在 GoDaddy 中创建的电子邮件,即 Office 365 Email Essentials.在电子邮件和Office(不是 Workspace 电子邮件或来自 cPanel).我正在使用带有 cPanel 包的经济型 Linux 主机.

The email being used is the email created in GoDaddy which is Office 365 Email Essentials. Under Email & Office (Not Workspace Email or from cPanel). I'm using Economy Linux Hosting with cPanel package.

我是 GoDaddy 的新手,所以这个问题对我来说是新的.在 InMotion 等一些托管服务提供商中,我从未遇到过这个问题.

I'm new to GoDaddy so this problem is new to me. In some hosting providers like InMotion, I've never encountered this problem.

推荐答案

Godaddy 对服务器中继设置做了一些更改.我们不再需要单独提及中继服务器设置.以下更改将适用于 PHPMailer.

Godaddy made few changes the server relay setting. we don't need to separately mention the relay server settings anymore. following changes will works fine with PHPMailer.

$mail = new PHPMailer;

$mail->SMTPDebug = 0;

$mail->isSMTP();

$mail->Host = 'localhost';

$mail->端口 = 25;

$mail->ssl = false;

$mail->authentication = false;

这篇关于关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题

基础教程推荐