我正在尝试在CodeIgniter上设置SMTP.一切正常,我在页面上收到成功消息,发送的电子邮件没有错误.但是,电子邮件未送达.
这是我使用的代码:
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'my-email@gmail.com',
'smtp_pass' => '***',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$this->load->library('email', $config);
$this->email->from('my-email@gmail.com', 'Explendid Videos');
$this->email->to('my-email@gmail.com');
$this->email->reply_to('my-email@gmail.com', 'Explendid Videos');
$this->email->subject('Explendid Video - Contact form');
$message = "Contact form\n\n";
$message .= "Name: ". $_POST['name'] . "\n";
$message .= "Phone: ". $_POST['phone'] . "\n";
$message .= "Email: ". $_POST['email'] . "\n";
$this->email->message($message);
$this->email->send();
Run Code Online (Sandbox Code Playgroud)
可能是什么原因,电子邮件实际上没有交付.