php 为什么通过codeigniter电子邮件是要与完整的信息垃圾邮件文件夹?

nsc4cvqm  于 2022-11-21  发布在  PHP
关注(0)|答案(2)|浏览(99)

你好,我正在使用CodeIgniter与PHP技术,我从应用程序发送电子邮件,但电子邮件被发送到收件人的垃圾邮件文件夹。

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

$config['protocol'] = 'sendmail';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';

$this->email->initialize($config);

$this->email->from('aaaa@domain.com', 'MYRegistration');
$this->email->to('abc@domain.com');

$this->email->subject('Congratulation ! You are a User.');
$this->email->message('html code');
$KsbMailStatus = $this->email->send();

这封电子邮件包含一些图片和链接,也因为这是一个注册电子邮件。

ruarlubt

ruarlubt1#

由于这一行,电子邮件被过滤为垃圾邮件

$this->email->subject('Congratulation ! You are a User.');

把它换成别的东西

$this->email->subject('hi thanks for the subscription.');
uidvcgyl

uidvcgyl2#

$this->email->from('aaaa@domain.com', 'MYRegistration');

发件人电子邮件地址“aaaa@domain.com”应存在。
将其更改为存在的有效电子邮件地址。
可能会解决您的问题

相关问题