Jump to content
php.lv forumi

email encoding


Sugarfree
 Share

Recommended Posts

'safe mode' problēma atrisinājās, biju jau sapriecājies, bet joprojām tā pati vecā dziesma... Vēstules nāk ar nepareizu encoding jeb tā teikt, encoding iekš message source vispār nepārādās. Nu vai kāds, lūdzu, nevar pateikt, kur man ir tā kļūda?

 

<?php
$EmailTo = "paraugs@paraugs.lv";
$Name = $_POST['Name'];
$Email = $_POST['Email'];
$Phone = $_POST['Phone'];
$Message = $_POST['Message'];

// The body text of your email

$Body = "";
$Body .= "Vards: ";
$Body .= $Name;
$Body .= "
";
$Body .= "e-pasts: ";
$Body .= $Email;
$Body .= "
";
$Body .= "Talrunis: ";
$Body .= $Phone;
$Body .= "
";
$Body .= "Teksts: ";
$Body .= $Message;
$Body .= "
";

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";

// command that calls the php mail() function
mail($EmailTo, $Subject, $Body, "From: $Email", $headers);
?>

Link to comment
Share on other sites

$headers	  .= 'To: '.$MailTo.' <'.$MailTo.'>'.$eol;
$headers	  .= 'From: '.$SenderName.' <'.$SenderMail.'>'.$eol;
$headers	  .= "Message-ID: <".$Momentn."@".$Servername.">".$eol;
$headers	  .= 'Date: '.date("r").$eol;
$headers	  .= 'Sender-IP: '.$_SERVER["REMOTE_ADDR"].$eol;
$headers	  .= 'X-Mailser: iPublications Adv.PHP Mailer 1.6'.$eol;
$headers	  .= 'MIME-Version: 1.0'.$eol;
$bndp		  = md5(time()).rand(1000,9999);
$headers	  .= "Content-Type: multipart/mixed; $eol	   
boundary=\"".$bndp."\"".$eol.$eol;

 

Man vajadzētu tātad to $Body vietā likt $header? Kaut kā tā? ;/

Link to comment
Share on other sites

 Share

×
×
  • Create New...