首页 > 解决方案 > 如何不延迟地发送邮件

问题描述

我必须用不同的信息向 5 个人发送邮件。我正在使用 SMTP 发送邮件,使用下面的代码发送邮件,但由于延迟响应,它有一些延迟。我怎样才能毫不拖延地发送邮件?

这是我正在使用的代码

$email  = '';
$from  = '';
$subject  = '';
$message  = 'Message';

$config = Array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.googlemail.com',
    'smtp_port' => 465,
    'smtp_user' => '',
    'smtp_pass' => '',
    'mailtype'  => 'html', 
    'charset'   => 'utf-8'
);
$this->load->library('email');
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->from($from, '');
$this->email->to($email);
$this->email->subject($subject);
$this->email->message($message);
$result = $this->email->send();

标签: phpcodeigniter

解决方案


推荐阅读