hello You’ll still use mail() function, but with a little more twists in the header argument – yes, the content of the attached file is actually encoded into the header of the email, can you believe that. Big head. this class AttachmentEmail that you can email an attachment with PHP more easily. All the chores are taken care of. It’s written in a hurry so the structure can sure be better. Other than this, it works like a chaarm. example: example.php [170 B] <?php require ('Email-Attachment.php'); $sendit = new AttachmentEmail('marry@example.com', 'Merry Christmas!', 'Hi', '/home/racker/gift.jpg'); $sendit -> mail(); ?> PHP: view the class:Email-Attachment.php [2.66 KB] class on jooria refresh your website
Well, I prefer PHPMailer because it has a lot of great features like attachments support, UTF-8, HTML mails etc