开发者

what is the exact code needed for a php to interact with an smtp server and send email? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Sending mass email using PHP

Does anyone out there know? I am trying to set up a php file to send data submitted in a form to a mysql database and also one of three email addresses (by means of an if statement). However, I am being told, I need to set up and manage an smtp server and also write code in my php file that connects with smtp server so that it will be possible for me to send email. However, I don't know how to do any of these things and if there is someone out there who does, would you mind helping me out? If so, I would gre开发者_StackOverflow中文版atly appreciate it.


I don't know if anybody is going to give you exact code, but I highly recommend the SwiftMailer library.

Read through the documentation a bit and try it out. It supports sending through your SMTP server instead of using the PHP mail() function.


If you are familiar with Zend framework, there is also a pretty advanced mail feature : Zend_Mail


Reading the PHP manual's page for mail() would be a good start


PHP doesn't actually send the mail. You need a mail server setup on a host machine that is listening for connections. Then in your code you can just use the mail command to actually send the email.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜