<?php // Instantiate the class $mail = new htmlMimeMail5(); // Set the From and Reply-To headers $mail->setFrom('Jason <*****@*****.**>'); $mail->setReturnPath('*****@*****.**'); // Set the Subject $mail->setSubject('Test with attached email'); // Set the body $mail->setText("Please find attached Chapter 16. Thank you!"); // Retrieve a file for attachment $attachment = $mail->getFile('chapter16.doc'); // Attach the file, assigning it a name and a corresponding Mime-type. $mail->addAttachment($attachment, 'chapter16.doc', 'application/vnd.ms-word'); // Send the email to editor@example.com $result = $mail->send(array('*****@*****.**'));