Я пытаюсь отправить электронное письмо с помощью CodeIgniter через Gmail SMTP, но функция не работает. На локальном хосте отображается эта ошибка?
An Error Was Encountered Unable to send email using PHP mail().
Your server might not be configured to send mail using this method.
Вот моя функция электронной почты
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '******@gmail.com', // change it to yours
'smtp_pass' => '**********', // change it to yours
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$message = 'Test';
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('*********@gmail.com'); // change it to yours
$this->email->to('[email protected]');// change it to yours
$this->email->subject('Resume from JobsBuddy for your Job posting');
$this->email->message($message);
if($this->email->send())
{
echo 'Email sent.';
}
else
{
show_error($this->email->print_debugger());
}
Подробнее здесь: https://stackoverflow.com/questions/669 ... erver-migh
Обнаружена ошибка. Невозможно отправить электронную почту с помощью PHP mail(). Возможно, ваш сервер не настроен для отп ⇐ Php
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение