A McGraw Hill Book Plug-in PHP: 100 Power Solutions
By Robin Nixon (McGraw Hill 2010, ISBN 978-0071666596)

Home | About | Buy It | Download | Contact

Select Chapter: 1  2  3  4  5  6  7  8  9 10 11 12

Chapter 6: Plug-in 38 - Send Email

Often after receiving user input you need to send an email, perhaps to yourself, to a colleague or maybe to the email submitter, thanking them for their input. Sending an email from your server isn't too hard using PHP's in-built mail() function. But if you want to send CCs or BCCs you have to start assembling headers and it starts to get complicated. Using this plug-in all that's handled for you. You just supply the message and subject lines and the email addresses of all recipients and it gets on with sending the email for you. You can even specify a different Reply-To address if you need to.

The Figure shows an email that has been successfully sent.