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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Needing help on confirmation email

    I have the following php script for my contact page. I am wanting to add a feature to where it will send the user a copy of the email that I am getting. Here is the code I have. Any help would be great.

    <?php

    $name_recipient = "Timbo";
    $email_recipient = "mail@mail.net";
    $name_sender = $_POST['lastname'];
    $email_sender = $_POST['email'];
    $subject = "Feedback/Comments From 52Designs.net";
    $headers = "From: ".$name_sender." <".$email_sender.">\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $message = "
    <html><head></head>
    <body text=FFFFFF background=bg.gif>
    <center><table width=500 border=1 cellspacing=1 cellpadding=1 background=emailbg.gif>
    <tr><td align=center colspan=2 bgcolor=000000><img src=52DIB2L.gif></td></tr>
    <tr><td colspan=2 align=center><b>Contact Information</b></td></tr>
    <tr><td align=left>Name:&nbsp;&nbsp;</td><td>".$_POST['Name']."</td></tr>
    <tr><td align=left>Company:&nbsp;&nbsp;</td><td>".$_POST['Company']."</td></tr>
    <tr><td align=left>E-Mail:&nbsp;&nbsp;</td><td>".$_POST['email']."</td></tr>
    <tr><td align=left>Phone Number:&nbsp;&nbsp;</td><td>".$_POST['Phone']."</td></tr>
    <tr><td align=left>Address:&nbsp;&nbsp;</td><td>".$_POST['Address']."</td></tr>
    <tr><td align=left>City/State/Zip Code:&nbsp;&nbsp;</td><td></td>".$_POST['csz']."</tr>
    <tr><td align=left>How to contact:&nbsp;&nbsp;</td><td>".$_POST['Contact_Preference']."</td></tr>
    <tr><td align=left>Message:&nbsp;&nbsp;</td><td>".$_POST['Message']."</td></tr></table></center>
    </body>
    </html>

    ";

    $bericht = nl2br($message);
    mail($email_recipient, $subject, $message, $headers);

    ?>

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    The PHP manual's page on mail() contains examples of how to send email to multiple recipients.

  • #3
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    I don't think you'd want to send a copy of it to the user though. You'd more likely send a separate email that thanks the user and lets them know it has been received.

    BTW: Hallo

  • #4
    New to the CF scene
    Join Date
    Feb 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the info. Last night after messing around with it, i just kinda thought of how it may do it and tried it and it did. But thanks for the website and your help. Yeah I am kinda new to php, i have worked with it before but nothing ever in depth. I am wanting to know more about how everything works. Thanks Guys

    Timbo


  •  

    Posting Permissions

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