发送电子邮件使用CodeIgniter显示到Gmail“消息发送”在收件箱中,但没有什么?(Send

2019-09-29 06:50发布

我下面这个惊人的nettusts +教程有关发送电子邮件到Gmail。

它aparently工作。 当我加载网页,它说:“你的电子邮件被发送,傻瓜。” 但后来我检查我的Gmail,有什么也没有。

是否笨照顾一切的? 或者我必须安装SMTP或东西在我的电脑,因为我使用本地主机(LAMP在Ubuntu)?

码:

 /* SEND EMAIL WITH GMAIL */ class Email extends Controller { function __construct() { parent::Controller(); } function index() { $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'janoochen@gmail.com', 'smtp_pass' => '***', ); $this->load->library('email', $config); $this->email->set_newline("\r\n"); $this->email->from('janoochen@gmal.com', 'Alex Chen'); $this->email->to('janoochen@gmal.com'); $this->email->subject('This is an email'); $this->email->message('It is working. Great!'); if($this->email->send()) { echo 'Your email was sent, fool.'; } else { show_error($this->email->print_debugger()); } } } 

Answer 1:

I don't know if this is it, but in your code you've got @gmal.com instead of @gmail.com



文章来源: Sending email to gmail with CodeIgniter displays “message sent” but there nothing in the inbox?