0

I have a contact form for a HTML page. Right now the recipient is only one. How can I add multiple recipient. Any help on this would be a great help.

Code is below.

Thanks.

<?php

$to = "support@domain.in";

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

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

$headers="";
$headers = "From: test <domain@one.com>\n";
$headers .= "Reply-To: $replyto";

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

?>

Parvez A.
  • 57
  • 1
  • 6

1 Answers1

1

Here is your sample code

     $to = "xyz@somedomain.com";
     $subject = "This is subject";

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

     $header = "From:abc@somedomain.com \r\n";
     $header .= "Cc:afgh@somedomain.com \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...";
     }
Web Artisan
  • 1,870
  • 3
  • 23
  • 33