godaddy codeigniter 电子邮件已发送但未到达

问题描述 投票:0回答:3

抱歉,又一个

godaddy/codeigniter
电子邮件问题。如果这里有类似的回答帖子,但我找不到适合我的帖子,我深表歉意。

我已将我的(工作)站点从本地移动到

GoDaddy
,在尝试各种设置后,我在电子邮件配置中有以下内容

$config['useragent']           = "CodeIgniter";
$config['mailpath']            = "/usr/sbin/sendmail"; // or "/usr/sbin/sendmail"
$config['protocol']            = "sendmail";
$config['smtp_host']           = "relay-hosting.secureserver.net";
$config['smtp_port']           = "25";
$config['smtp_user']    = '[email protected]';
$config['smtp_pass']    = 'mypassword';
$config['mailtype'] = 'html';
$config['charset']  = 'utf-8';
$config['newline']  = "\r\n";
$config['wordwrap'] = TRUE;
$config['crlf'] = "\r\n";

与这里绝大多数类似的帖子不同,我的电子邮件似乎正在发送,因为如果我使用

echo $this->email->print_debugger();

我得到以下信息:

Your message has been successfully sent using the following protocol: sendmail
User-Agent: CodeIgniter
Date: Wed, 12 Feb 2014 14:02:34 -0700
From: "me" <>
Return-Path: <>
To: [email protected]
Subject: =?utf-8?Q?Please_reset_your_password_at_CellKulture?=
Reply-To: "" <>
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <52fbe16a8c43a>
Mime-Version: 1.0

但是电子邮件从未到达我的地址。我尝试过将电子邮件发送到 Gmail 和另一个地址。你能帮忙吗?

php codeigniter email
3个回答
6
投票

经过漫长的两天,我使用以下配置解决了这个问题:

$config['protocol'] = 'sendmail';
$config['smtp_host'] = 'localhost';
$config['smtp_user'] = '';
$config['smtp_pass'] = '';
$config['smtp_port'] = 25;

$this->load->library('email', $config);

我在 Godaddy 服务器中使用 CodeIgniter。

消息在1-2分钟内送达。


0
投票

我最终通过使用 sendgrid 并绕过 godaddy 解决了这个问题


0
投票

如果您使用 cpanel,请先转到 cpanel 搜索电子邮件路由并选择远程邮件交换器选项,然后单击更改按钮。 之后这段代码对我有用。

$config['protocol'] = 'sendmail';
$config['smtp_host'] = 'smtpout.secureserver.net';
$config['smtp_user'] = 'your_email';
$config['smtp_pass'] = 'your_password';
$config['smtp_port'] = 465;

$this->load->library('email', $config);

$this->config->load('email', TRUE);
$mail_config = $this->config->item('email');

$data = array(
         'username'=> 'your_email',
         'content' => 'Send mail',
             );
             
$this->load->library('email'); 
$this->email->initialize($mail_config);
$this->email->set_newline("\r\n");

$this->email->from('your_email');
$this->email->to('your_email');
$this->email->subject('subject');

$this->email->message($this->load->view('email/' . $type . '-html', $datas, TRUE));
$this->email->set_alt_message($this->load->view('email/' . $type . '-txt', $datas, TRUE));

if ($this->email->send(FALSE))
    return TRUE;
else
    return FALSE;
© www.soinside.com 2019 - 2024. All rights reserved.