How to send mail via smtp using ssl in php

蹲街弑〆低调 提交于 2019-12-11 19:43:03

问题


How can I send mail via smtp using ssl? We are able to send the simple text mail, but it's not allowing the links or certain tags in the mail to pass, we tried using pear-mail.

Please suggest any options.

We are using third party GMAIL and hosting is in Godaddy. All mx record are fine and earlier we were able to deviver mails when we have not used ssl, also as i mentioned we are able to send the simple text mails with ssl, so please no answers regarding hostings, just any options how to use it with ssl.


回答1:


You might want to look at phpmailer. You can use phpmailer to send outgoing messages through gmail's SMTP server (smtp.gmail.com), and it has options to connect to the SMTP server by SSL. phpmailer is very simple to setup - just a few PHP files to copy to your server. See https://github.com/PHPMailer/PHPMailer. You can start sending mail using the simple example at the github page above as a boilerplate.



来源:https://stackoverflow.com/questions/18748122/how-to-send-mail-via-smtp-using-ssl-in-php

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