Article

Advanced email in PHP

Page: 1 2 3 4 5 6

Summary

In this article, you probably learned a lot more about email than you ever wanted to know. That intimate knowledge about what makes email tick allowed us to do some pretty special things with PHP's deceptively simple mail function.

  • we learned how to manipulate email headers to play with the recipients of an email
  • we saw the headers that permit you to send HTML email
  • we combined the HTML and text versions of an email into a single, mixed message

and finally...

  • we brought it all together with a couple of new tricks to send email messages with file attachments.

If you're in the mood for a challenge, try expanding the file attachment script in this article to allow for multiple file attachments, or to allow for an HTML message. If you're an object oriented PHP type, try developing a class that encapsulates the functionality we explored in this article (there are a number of such scripts available on the Internet if you're after something ready-made).

If you're really interested, check out the RFC for MIME extensions (RFC 2045) to discover everything that email is capable of, then go wild!

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links

Rate This Article

  • 1
    Poor
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
    Great

Comment on This Article

Have something to say?

Post A Comment

You need to be a member of the SitePoint Forums to comment on this post. Sign Up

Already a member? Post using your SitePoint Forums account: