Codeigniter:发送来自不同发件人的两封电子邮件

时间:2016-09-07 08:42:06

标签: codeigniter email

我正在尝试发送两封电子邮件,每封都来自不同的发件人。问题是第二封电子邮件是从第一封电子邮件的发件人发送的。 Codeigniter忽略了第二封电子邮件的$this->email->from

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

$html="some text";

 // send email
$config['mailtype'] = 'html';
$config['protocol'] = "smtp";
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_user'] = 'user@gmail.com';
$config['smtp_pass'] = 'password';
$config['smtp_port'] = '465';
$config['newline'] = "\r\n";
$this->email->initialize($config);


$this->email->from('myemail@gmail.com', '');

$this->email->to("someemail@site.com");

$this->email->subject("The subject");
$this->email->message($html);

if($this->email->send()) {

}            

$this->email->clear();


$config1['mailtype'] = 'html';      
$this->email->initialize($config1);

$this->email->from('thesecondemail@www.com', 'The test');

$this->email->to("user@eee.com");
$html="Some other text";

$this->email->subject("hello some text");
$this->email->message($html);
if($this->email->send()) {

}

0 个答案:

没有答案
相关问题