sushiX Posted June 11, 2009 Share Posted June 11, 2009 Hey, I am trying to get this code to send a attachment with an email though the attachment reaches the mailbox there is no text in the body of the email message. if you can suggest any changes to the script to make it work.the link to the code is given below http://pastie.org/508314 Link to comment https://forums.phpfreaks.com/topic/161813-sending-email-with-a-attachment/ Share on other sites More sharing options...
gijew Posted June 11, 2009 Share Posted June 11, 2009 If you really want to make your life easier just use PHPMailer http://phpmailer.codeworxtech.com/ It'll make things like this a snap! As far as your script goes you don't have `.=` on $email_message on the second instance. Change this... $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message . "\n\n"; to $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message .= "\n\n"; Link to comment https://forums.phpfreaks.com/topic/161813-sending-email-with-a-attachment/#findComment-853837 Share on other sites More sharing options...
moe180 Posted June 12, 2009 Share Posted June 12, 2009 hi, i have had a similar problem and have managed to sort it, This may suit your purpose but you will have to add some security to it as I am still doing that at the moment to my code. hope it helps. http://www.phpfreaks.com/forums/index.php/topic,256046.0.html Link to comment https://forums.phpfreaks.com/topic/161813-sending-email-with-a-attachment/#findComment-854378 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.