php - PHP 邮件程序不适用于 CWP(控制 Web 面板 CentOs)电子邮件设置
问题描述
我为域https://www.srirangapankajam.in/创建了新的电子邮件 ID
以下是电子邮件 ID 详细信息。
邮箱登录网址:https ://server.we3.in:2031/roundcube/
电子邮件 ID:info@srirangapankajam.in
密码 : *******
我尝试使用上述凭据登录,但显示服务器错误并且也无法使用 PHP 库发送电子邮件。
我也在 github https://github.com/PHPMailer/PHPMailer/issues/1715
我使用以下代码发送邮件。
$mail->SMTPDebug = 2; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'server.we3.in'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'info@srirangapankajam.in'; // SMTP username
$mail->Password = '*****'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->setFrom('info@srirangapankajam.in', 'Testing');
$mail->addAddress('siddharthundare@gmail.com');
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
尝试使用 SMTP 发送邮件时出现以下错误:
2019-04-29 09:29:21 SERVER -> CLIENT: 220 server.we3.in ESMTP Postfix 2019-04-29 09:29:21 CLIENT -> SERVER: EHLO localhost
2019-04-29 09:29:21 服务器-> 客户端:250-server.we3.in250-PIPELINING250-SIZE 204800000250-ETRN250-STARTTLS250-AUTH 普通登录 250-AUTH=普通登录 250-ENHANCEDSTATUSCODES250-8BITMIME250DSN
2019-04-29 09:29:21 客户端 -> 服务器:STARTTLS 2019-04-29 09:29:21 服务器 -> 客户端:220 2.0.0 准备启动 TLS SMTP 错误:无法连接到 SMTP 主机。
2019-04-29 09:29:21 客户端-> 服务器:退出 2019-04-29 09:29:21 2019-04-29 09:29:21 SMTP 错误:无法连接到 SMTP 主机。
无法发送消息。邮件程序错误:SMTP 错误:无法连接到 SMTP 主机。
解决方案
推荐阅读
- python - Django Wsgi ModuleNotFoundError:没有名为“project_name”的模块
- python - 如何让 nmap 运行得更快?
- python - 使用 TFX 实现 Kubeflow 管道时出现“MaxRetryError”
- python - 重命名包含大量嵌套模块的包中的子模块和子模块功能
- database - 多分支 Postgres 复制
- javascript - AWS Node.js 无效标记压缩接近堆限制分配失败 - JavaScript 堆内存不足
- android - Kotlin EditText.setText() 有问题
- reactjs - 语法错误:意外的令牌 - statusList?.length
- c# - 如何在 wpf 中编辑单元格?
- firebase - Xamarin.Firebase.Crashlytics 118.0.1