Archive for April, 2007

Email Attachments in PHP

I've often been asked how to not just send emails from PHP, but how to send an attachment within the email as well. To send an attachment, you need to add extra headers, base64 encode the file and so on. In fact, it's not very easy to do.

However, there is a script around that makes this a lot easier by handling all the donkey work - PHPMailer. PHPMailer can handle almost anything you want to throw at it, including embedding images within the email, full blown HTML emails, using external SMTP servers to send the emails and so on. However, today, we're going to just concentrate on using PHPMailer to send an email with an attachment.

2 comments April 28th, 2007


Calendar

April 2007
M T W T F S S
« Aug   Aug »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Posts by Month

Posts by Category