我在鳕鱼点火器中使用电子邮件库发送邮件。有时它的工作有时候不是。它随意停止,是否有任何永久的解决方案? 我尝试过所有这些选择 1.重新启动服务器 2.对系统/库/ Email.php进行了更改 3.将协议从smtp更改为sendmail 4.将smtp端口更改为465到587。 5. opend
发送邮件功能代码
$this->load->library('email');
$subject = "Test Mail with check";
$fromemail ="demo@gmail.com";
$toemail = "demo1@gmail.com";
$cc = "demo2@gmail.com";
$this->email->to($toemail);
$this->email->cc($cc);
$this->email->bcc($bcc);
$this->email->from($fromemail, "$subject");
$this->email->subject($subject);
$this->email->message($mesg);
$mail = $this->email->send();
echo $this->email->print_debugger();
Email.php代码
var $useragent = "CodeIgniter";
var $mailpath = "/usr/sbin/sendmail";
var $protocol = "sendmail";
var $smtp_host = "ssl://smtp.gmail.com";
var $smtp_user = "somemail@gmail.com";
var $smtp_pass = "******";
var $smtp_port = "587";
var $smtp_timeout = 5;
var $smtp_crypto = "";
var $wordwrap = TRUE;
var $wrapchars = "76";
var $mailtype = "html";
var $charset = "utf-8";
var $multipart = "mixed";
var $alt_message = '';
var $validate = FALSE;
var $priority = "3";
var $newline = "\r\n";
var $crlf = "\r\n";
输出
Your message has been successfully sent using the following protocol: sendmail
To: demo@gmail.com
Cc: demo1@gmail.com
From: "Test Mail with check" <somemail@gmail.com>
Return-Path: <sommail@gmail.com>
Subject: =?utf-8?Q?Test_Mail_with_check?=
Reply-To: "somemail@gmail.com" <somemail@gmail.com>
X-Sender: somemail@gmail.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <5797207b7169a@yoboho.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_5797207b716d4"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_5797207b716d4
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
This is testing Mail
--B_ALT_5797207b716d4
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
This is testing Mail
--B_ALT_5797207b716d4--
电子邮件ID只是演示。在实际代码中,我使用了正确的电子邮件ID。