gpt4 book ai didi

php - 无法使用 PHP SMTP 发送电子邮件,无法发送 AUTH LOGIN 命令。错误

转载 作者:行者123 更新时间:2023-12-04 16:14:16 24 4
gpt4 key购买 nike

过去 3 天我一直在尝试解决这个问题,并搜索了许多网站和 stackoverflow 问题,但我的代码似乎很完美,但仍然无法正常工作。

function send_email(){
$this->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "mail.shadowmail.com.au";
$config['smtp_port'] = 587;

$config['smtp_timeout']='30';

$config['smtp_user'] = "my email id here "; //
$config['smtp_pass'] = "******";

$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->from("my email id here ", "Test");

$this->email->to("jack@gmail.com");

$this->email->subject("heading");
$this->email->message("heyyyyyyyyyyyy");
if($this->email->send()){
echo "done";
}else{echo "fail";
show_error($this->email->print_debugger());
}
}

我收到这个错误

220 Sol1-SMEX01.shadowmail.sol1 Microsoft ESMTP MAIL Service ready at Thu, 18 Jan 2018 10:39:18 +1100 

hello: 250-Sol1-SMEX01.shadowmail.sol1 Hello [1.136.213.103]
250-SIZE 41943040
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250 CHUNKING
Failed to send AUTH LOGIN command. Error: 504 5.7.4 Unrecognized authentication type
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
Date: Thu, 18 Jan 2018 00:39:28 +0100
From: "Test" <my email id was here , i just replaced it with this text>
Return-Path: <my email id was here , i just replaced it with this text>
To: jack@gmail.com
Subject: =?UTF-8?Q?heading?=
Reply-To: <my email id was here , i just replaced it with this text>
User-Agent: CodeIgniter
X-Sender: my email id was here , i just replaced it with this text
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <5a5fdeb00e005@example.com>
Mime-Version: 1.0


Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

heyyyyyyyyyyyy

这对您来说可能是个基本问题,但过去 3 天我一直在尝试,但仍然遇到同样的错误。看起来代码没问题,可能是我无法识别的错误。我的电子邮件 ID 和密码是正确的,我已多次登录以验证凭据是否有效。

最佳答案

Codeigniter 的电子邮件库似乎只支持最基本的、不安全的身份验证方法[LOGIN,基本上是明文],而您的 SMTP 服务器仅支持实际的安全身份验证方法。 [GSSAPINTLM]

您需要:

  1. 使用 TLS/SSL。
    • 安全通道通常允许不安全的身份验证,也就是 LOGIN
    • 很遗憾,您的主机似乎没有配置它,因为列出的功能中没有 STARTTLS
  2. 使用电子邮件库实际上支持其中一种方法。

在这些选项中,#1 是您最好的选择,因为:

  1. 在当今时代,您既不应该使用也不应该为不使用 SSL 的电子邮件主机付费。
  2. 我找不到任何对 GSSAPINTLM 的 PHP 电子邮件库广告支持。

TLDR:您将不得不对您的主人大喊大叫。

关于php - 无法使用 PHP SMTP 发送电子邮件,无法发送 AUTH LOGIN 命令。错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48311817/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com