2016-03-22 14 views
1

CC ile posta göndermek istiyorum. E-posta başarıyla gönderildi, ancak CC gönderilmez.PHP posta işlevinde CC ekleme

$to = '[email protected]'; 
$subject = 'Order Details of Order Number:'.$orderID; 
$headers = "From: [email protected]\r\nReply-To: [email protected]"; 
$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; 
$message = "Test Message"; 
$headers .= 'Cc: [email protected]' . "\r\n"; 
mail($to, $subject, $message, $headers); 

Ben HTML olarak bu postayı gönderiyorum.

+0

deneyin ekleyerek "\ r \ n" cc dizesi önce:. $ Başlıklarına = "\ r \ n". 'Cc: [email protected]'. "\ R \ n"; – mgalesic

cevap

0

aşağıdaki sırayla bu kodu ekleyin deneyin:

$headers = "From: $from_email\r\nReply-To: $from_email"; 
$headers .= 'Cc: [email protected]\r\n'; 
$headers .= 'Bcc: [email protected]\r\n'; 
$headers .= "Return-Path: <[email protected]>\r\n"; 

//add boundary string and mime type specification 
$headers .= "Content-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\""; 

Resource

+0

Kodunuzu denedim, yalnızca ana alıcıya gönderir, bu da gereksiz ve html biçiminde değil – Rajesh

+0

Karmaşık yerine içerik türü alternatifini kullanırsam, gelen kutusuna ve html biçimine gönderir, ancak cc $ başlıklarını çalıştırmaz . = "\ r \ nContent-Type: multipart/alternative; boundary = \" PHP-alt - ". $ random_hash." \ ""; – Rajesh