everurssantosh Posted September 24, 2008 Share Posted September 24, 2008 Hi , I am sending mails to our customers using the below code $headers = "From: ".$from_mail."\r\n"; $headers .= "BCC: " . $email_ids ."\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $boundary = uniqid("HTMLDEMO"); $headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n"; $body .= "--$boundary\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $toemail = get_hotel_email($int_pid,$conn); $toemail = $toemail .",". $str_guest_email1.",". $str_guest_email2 ; $body .= chunk_split(base64_encode($return_html),68,"\n"); mail($toemail, $mail_booking_4 , $body, $headers); This program works perfectly for GMAIL and YAHOO. But while using some other emails, instead of showing the right message, it shows some junk characters. Below shown the Junk Characters in the mail Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 PHRhYmxlIGNlbGxwYWRkaW5nPTQgY2VsbHNwYWNpbmc9NCBib3JkZXI9MD48dHI+PHRkPjx0YWJs ZSB3aWR0aD0iMTAwJSIgYm9yZGVyPTAgIGNlbGxwYWRkaW5nPTAgY2VsbHNwYWNpbmc9MCA+PHRy Pjx0ZCA+PGZvbnQgc2l6ZT0zIGNvbG9yPWJsdWU+PGI+RGVhciBNci4gQ29ycmFkbyBSYWNjYTxi cj48YnI+VGhhbmsgeW91IGZvciB5b3VyIFJlc2VydmF0aW9uLjxicj48YnI+WW91IHdpbGwgZmlu ZCBoZXJlIGFsbCBkZXRhaWxzIGFib3V0IFlvdXIgcmVzZXJ2YXRpb24gOiA8YnI+PGJyPkNvbmZp cm1hdGlvbiBOdW1iZXI6PC9iPiBDUlZDWE44RFNJQUZaMEEwJm5ic3A7Jm5ic3A7PGI+RGF0ZTwv Yj4yMi8wOS8yMDA4Jm5ic3A7Jm5ic3A7PGI+VGltZTogPC9iPiAxMTo0OSBhbTwvZm9udD48L3Rk PjwvdHI+PC90YWJsZT48L3RkPjwvdHI+PHRyPjx0ZD48dGFibGUgd2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3IFlvcms8YnI+SXRhbHk8YnI+ PC9mb250PjwvdGQ+PHRkIHZhbGlnbj10b3A+PGZvbnQgZmFjZT0iQ2VudHVyeSBHb3RoaWMiIHNp emU9IjEiPmVtYWlsMjogIGNvcnJhZG9yY2NAeWFob28uY29tPC9mb250PjwvdGQ+PC90cj48L3Rh YmxlPjwvdGQ+PC90cj48dHI+PHRkPiZuYnNwOzwvdGQ+PC90cj48dHI+PHRkPjx0YWJsZSB3aWR0 aD0xMDAlIGJvcmRlcj0wIGNlbGxzcGFjaW5nPTAgY2VsbHBhZGRpbmc9MD48dHIgPjx0ZCB3aWR0 aD00OSU+PHRhYmxlIGNlbGxwYWRkaW5nPTAgY2VsbHNwYWNpbmc9MCBib3JkZXI9MCB3aWR0aD0x MDAlPjx0ciA+CTx0ZCBjb2xzcGFuPTIgYWxpZ249bGVmdCBzdHlsZT0iaGVpZ2h0OjI1cHgiIGJn Y29sb3IgPSAjNjZDQzY2Pjxmb250IGZhY2U9IkNlbnR1cnkgR290aGljIiBzaXplPSIyIj48Yj5T ZWxlY3RlZCBIb3RlbCAgPC9iPjwvZm9udD48aHI+PC90ZD48L3RyPjx0cj48dGQgY29sc3Bhbj0y Pjxmb250IGZhY2U9IkNlbnR1cnkgR290aGljIiBzaXplPSIxIj5Db2x1bWJ1cyBIb3RlbDwvZm9u Kindly Help me to solve this problem !! Thanks Santosh Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/ Share on other sites More sharing options...
jonsjava Posted September 24, 2008 Share Posted September 24, 2008 those "junk characters" are just mime encoding. Looks like a valid e-mail. Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649464 Share on other sites More sharing options...
everurssantosh Posted September 24, 2008 Author Share Posted September 24, 2008 Hi I could understand that is MIME type.. but how to show the original email ??? Thanks Santosh Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649469 Share on other sites More sharing options...
everurssantosh Posted September 24, 2008 Author Share Posted September 24, 2008 Anybody Could Come up with a solution for my problem??? Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649548 Share on other sites More sharing options...
thesaleboat Posted September 24, 2008 Share Posted September 24, 2008 well not anybody but im sure somebody could lol Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649549 Share on other sites More sharing options...
everurssantosh Posted September 24, 2008 Author Share Posted September 24, 2008 well not anybody but im sure somebody could lol was this a joke??? Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649552 Share on other sites More sharing options...
thesaleboat Posted September 24, 2008 Share Posted September 24, 2008 i believe it may have been, i know nothing about encryption but this post will put ur topic back on top lol='s laugh out loud lol Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649570 Share on other sites More sharing options...
dennismonsewicz Posted September 24, 2008 Share Posted September 24, 2008 why are you encoding the email? Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649599 Share on other sites More sharing options...
everurssantosh Posted September 24, 2008 Author Share Posted September 24, 2008 why are you encoding the email? The mail is delivered encoded !!! I am not sure why it is encoding the mail content for some particular mail server.... Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649604 Share on other sites More sharing options...
dennismonsewicz Posted September 24, 2008 Share Posted September 24, 2008 try changing this line: $body .= chunk_split(base64_encode($return_html),68,"\n"); to $body .= $return_html; Try sending the mail without encoding the output Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649610 Share on other sites More sharing options...
448191 Posted September 24, 2008 Share Posted September 24, 2008 Locked for using all caps and exclamation marks in thread title. Don't do that. And please do not report posts that do not break any rules. We have better things to do. Link to comment https://forums.phpfreaks.com/topic/125618-php-mail-probem/#findComment-649612 Share on other sites More sharing options...
Recommended Posts