php-发送的CodeIgniter奇怪的电子邮件
作者:互联网
我有一个函数,可以传递参数以轻松发送电子邮件.
就是这个 :
function __construct() {
$this -> CI = get_instance();
$this -> CI -> load -> library('email');
}
public function send_one_email($single_email, $single_subject, $single_body, $single_attach) {
$this -> CI -> email -> clear();
$this -> CI -> email -> to($single_email);
$this -> CI -> email -> from('**************');
$this -> CI -> email -> subject($single_subject);
$this -> CI -> email -> message($single_body);
if ($single_attach) {
$this -> CI -> email -> attachment($single_attach);
}
if ($this -> CI -> email -> send()) {
return TRUE;
}
}
我收到的电子邮件是(我不应该收到):
?= =?utf-8?Q?2013?= Reply-To: “SUNYOrangeScholarInterface@gmail.com”
X-Sender:
SUNYOrangeScholarInterface@gmail.com X-Mailer: CodeIgniter X-Priority:
3 (Normal) Message-ID: <520eb8d943533@gmail.com> Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=”B_ALT_520eb8d943598″This is a multi-part message in MIME format. Your email application
may not support this format.–B_ALT_520eb8d943598 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit
Hello Rixhers Ajazi this is an automated email to notify you that your
account has been successfully created.You must wait for your account
to be verified meaning that you do not have access to use
ScholarInterface. Once your account is activated and you are given a
user role you will be notified via email.Please be advised that since
you have created your account you are responsible for keeping your
credentials safe. These include your email account, your answers to
your security questions, and your password itself.I (Rixhers Ajazi)
just want to warn you that if you do not keep your security answers
safe then some one can take over your account.Any questions what so
ever with ScholarInterface please email Rixhers Ajazi at
CoderRix@gmail.comAny questions pertaining to your account please
notify your Administrators. Rixhers Ajazi is not a Administrator but a
Super User (the coder of this program).–B_ALT_520eb8d943598 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hello Rixhers Ajazi this is an automated email to notify you that your
acco= unt has been successfully created.You must wait for your account
to be veri= fied meaning that you do not have access to use
ScholarInterface. On= ce your account is activated and you are
given a user role you will be noti= fied via email.Please be advised
that since you have created your account y= ou are responsible for
keeping your credentials safe. These include your em= ail account,
your answers to your security questions, and your password its= elf.I
(Rixhers Ajazi) just want to warn you that if you do not keep your se=
curity answers safe then some one can take over your account.Any
questions = what so ever with ScholarInterface please email
Rixhers Ajazi at Cod= erRix@gmail.comAny questions pertaining to your
account please notify your = Administrators. Rixhers Ajazi is not a
Administrator but a Super User (the = coder of this program).–B_ALT_520eb8d943598–
这是地狱吗?
这是我在email.php中的配置:
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_user'] = '********************@gmail.com';
$config['smtp_pass'] = '**************************';
$config['smtp_port'] = 465;
$config['smtp_timeout'] = 30;
$config['charset'] = 'utf-8';
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
我在另一个应用程序中使用了相同的脚本,但我从未得到过.任何帮助都会很棒.
解决方法:
电子邮件顶部的消息似乎是从主题标头开始的,因此我想这将是开始调试的好地方.
曾经有一个issue caused by Subject lines with more than 75 chars.
如果上述修复方法无效,则开发人员已修补Email.php来解决此问题:
https://github.com/EllisLab/CodeIgniter/issues/1409#issuecomment-9330713
标签:codeigniter,email,html-email,php 来源: https://codeday.me/bug/20191030/1968565.html