проблема с codeigniter и sendgrid - PullRequest
0 голосов
/ 02 мая 2020

Я пытаюсь использовать почтовый API SendGrid с моим кодом CodeIgniter. но получил ошибку тайм-аута соединения.

$this->email->initialize(array(
  'protocol' => 'smtp',
  'smtp_host' => 'smtp.sendgrid.net',
  'smtp_user' => 'apikey',
  'smtp_pass' => 'generatedPassword',
  'smtp_port' => 587,
  'crlf' => "\r\n",
  'newline' => "\r\n"
));

$this->email->from('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();

echo $this->email->print_debugger();

но получил эту ошибку.

Message: fsockopen(): unable to connect to smtp.sendgrid.net:587 (Connection timed out)

при замене,

protocol =>'smtp' to 'ssmpt' and everything with extra 's' like 'ssmtp_user' , 'ssmtp_pass'.

ошибка идет, но письмо отправлено с сервер не из sendgrid.

помогите пожалуйста, спасибо.

...