webmaster1 Posted January 11, 2009 Share Posted January 11, 2009 Hi All, I have a simple email process in form I've built: <?php $to = "$recipientemail"; $subject = "New message: $Howdy..."; $message = "Hi $recipientname,\n\n Further to our recent telephone conversation please find attached additional information regarding our package pricing.\n\nWe look foward to your response.\n\nKind Regards,\n$salesagentname"; $headers = "From: [email protected]"; // SEND THE EMAIL USING PHPs mail() function mail($to, $subject, $message, $headers); ?> I was hoping someone could point me in the direction of a few code economic tutorials. Everything I've searched so far is very longwinded. Is this the only way? (I searched Google under 'php attach pdf') Link to comment https://forums.phpfreaks.com/topic/140352-simple-email-how-do-you-attach-a-pdf/ Share on other sites More sharing options...
ratcateme Posted January 11, 2009 Share Posted January 11, 2009 have a look at this pear package something like this should do it http://pear.php.net/package/Mail_Mime $mime = new Mail_mime(); $to = "$recipientemail"; $subject = "New message: $Howdy..."; $mime->encodeRecipients($to); $mime->setSubject("New message: $Howdy..."); $mime->setTXTBody($message); $mime->addAttachment("file.pdf","application/pdf"); $mime->setFrom("[email protected]"); mail($to,$subject,$mime->getMessage()); Scott. Link to comment https://forums.phpfreaks.com/topic/140352-simple-email-how-do-you-attach-a-pdf/#findComment-734462 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.