Using Google Apps Email in CodeIgniter

旧街凉风 提交于 2019-12-08 03:36:22

问题


How do I use Google Apps' email services to send mail using the CodeIgniter email class? The email class seems to prefer SMTP, and I was going through the clients Google Apps account. I can't find any place within the Google Apps settings for SMTP. Does anyone know of a solution for this issue?


回答1:


Right you don't find it because CodeIgniter uses the "mail" PHP function.

For some reasons only the most drunken PHP core developer knows about - this function do not support SMTP and worse even the admin can't configure SMTP usuage on Unix (it is possible to do this on windows - making the PHP design look even more crazy).

There are a few SMTP libraries out there that can handle SMTP Email, just use them

http://pear.php.net/package/Mail http://sourceforge.net/projects/phpmailer/ http://swiftmailer.org/

or the Email classes from the Zend Framework which are uncoupled from the rest so easy to use with CodeIgniter.




回答2:


Here is a blog post detailing instructions: http://joelg.info/sending-email-with-gmail-using-the-codeignite

Extract From link:

Why send email with Gmail rather than the server's SMTP configuration? There are a number of advantages I see for doing this: Ability to develop locally and test email sending functionality without going to lengths to setup a local mail server. Ability to utilise Google Apps emails to send email from emails which are on your own domain. Ability to have a reference of the mail you send using this method in the "sent" folder on your Gmail account.



来源:https://stackoverflow.com/questions/1515089/using-google-apps-email-in-codeigniter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!