Results 1 to 2 of 2

Thread: How can I make the message be sent to 2 emails?

  1. #1
    Join Date
    May 2011
    Posts
    4

    How can I make the message be sent to 2 emails?

    Hi guys,
    I'm having a little problem I need help with. I created a form in HTML and I did the PHP code for the submission button. My question is, how can I make the message be sent to 2 different emails instead of one only.

    Here is my PHP code:

    <?php
    /*subject and email varibales*/

    $emailsubject = 'via Bo-sacs website';
    $webmaster = 'artweb99@gmail.com';

    /*gathering data variables*/

    $nameField = $_POST['name'];
    $emailField = $_POST['email'];
    $commentField = $_POST['comment'];



    $body = <<<EOD
    <br><hr><br>
    Name : $name <br>
    Email : $email <br>
    Comment : $comment<br>

    EOD;


    $headers = "From: $email\r\n";
    $headers = "Content-type: text/html\r\n";
    $success = mail($webmaster,$emailsubject,$body,$headers);



    /*Results randered as HTML */


    $theResults = <<<EOD


    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>merci</title>
    </head>

    <body>
    <p>Votre message a été envoyer, nous vous répondrons dans les plus bref délais

    </p>
    </body>
    </html>
    EOD;
    echo "$theResults";

    ?>


    Thank you

  2. #2
    Join Date
    Jun 2011
    Posts
    10
    If I understand correctly, all you have to do is replace your $webmaster bit with

    Code:
    $webmaster = 'artweb99@gmail.com, another@email.com';
    If you take a look at http://php.net/manual/en/function.mail.php it explains it in further detail.

Similar Threads

  1. Emails are also very helpful in pr
    By aone00 in forum Search Engine Optimization and Marketing
    Replies: 1
    Last Post: 04 Oct 2008, 03:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •