2016-04-30 8 views
0

私は、HTMLページの連絡フォームを持っています。今すぐ受信者は1つだけです。どのように複数の受信者を追加できますか?これに関する助けがあれば大きな助けになるでしょう。PHPコンタクトフォームにCCを追加するには?

コードは以下のとおりです。

ありがとうございました。 ?ここで

<?php 

$to = "[email protected]"; 

$name = $_POST['name']; 
$email = $_POST['email']; 
$message = $_POST['message']; 

$subject = "Message from $name ($email)"; 
$replyto = $email; 

$headers=""; 
$headers = "From: test <[email protected]>\n"; 
$headers .= "Reply-To: $replyto"; 

$result = mail($to,$subject,$message,$headers); 

>

+0

$ヘッダである= C-C ':[email protected]'。。 "\ r \ n";あなたは電子メールのリストを作ることができます – splash58

+2

[PHPメール、CCフィールド](http://stackoverflow.com/questions/3582126/php-mail-cc-field) – Shubhamoy

答えて

1

あなたのサンプルコードは

 $to = "[email protected]"; 
    $subject = "This is subject"; 

    $message = "<b>This is HTML message.</b>"; 
    $message .= "<h1>This is headline.</h1>"; 

    $header = "From:[email protected] \r\n"; 
    $header .= "Cc:[email protected] \r\n"; 
    $header .= "MIME-Version: 1.0\r\n"; 
    $header .= "Content-type: text/html\r\n"; 

    $retval = mail ($to,$subject,$message,$header); 

    if($retval == true) { 
     echo "Message sent successfully..."; 
    }else { 
     echo "Message could not be sent..."; 
    } 
+0

ありがとうBikashポールの可能な複製。やってみます。 –

関連する問題