Jump to content

Recommended Posts

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+PHR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IEdvdGhpYyIgc2l6ZT0iMSI+TmV3IFlvcms8YnI+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

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.