Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can I add more than one email receiver to a form?

    I am trying to have the form submited to more than just one email address. How can I add one more email to this script? Here is part of the script. Thank you in advance


    <?php


    $emailSubject = 'EmailMe!';
    $webMaster = 'myfirstemailaddress';
    ///////// I want to add another email address so that 2 people get the same info/////////

    $nameField = $_POST['name'];
    $emailField = $_POST['email'];
    $phonedayField = $_POST['phoneday'];
    $phoneeveningField = $_POST['phoneevening'];
    $timetocallField = $_POST['timetocall'];
    $commentsField = $_POST['comments'];

    $body = <<<EOD
    <br><hr><br>
    Email: $emailField <p>
    Name: $nameField <p>
    Daytime Phone Number: $phonedayField <p>
    Evening Phone Number: $phoneeveningField <p>
    Best to call: $timetocallField <p>
    Questions, Comments: $commentsField <p>
    EOD;

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

  • #2
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    PHP Code:
    $email 'EmailMe!';
    $webMaster 'myfirstemailaddress';


    $success mail($email$emailsubject$body$headers); 
    $success mail($webMaster$emailsubject$body$headers); 
    Leonard Whistler


  •  

    Posting Permissions

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