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

2024-08-23php开发问题
17

本文介绍了关于如何在 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 的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

PHP实现DeepL翻译API调用
DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以...
2025-08-20 php开发问题
168

PHP通过phpspreadsheet导入Excel日期数据处理方法
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的...
2024-10-23 php开发问题
287

mediatemple - 无法使用 codeigniter 发送电子邮件
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)...
2024-08-23 php开发问题
11

Laravel Gmail 配置错误
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)...
2024-08-23 php开发问题
16

将 PHPMailer 用于 SMTP 的问题
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)...
2024-08-23 php开发问题
4

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)...
2024-08-23 php开发问题
17