Results 1 to 4 of 4

Thread: php contact engine

  1. #1
    Join Date
    Aug 2009
    Location
    London
    Posts
    84
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Default php contact engine

    Hi,

    Please can someone show me how to add more than one forwarding email in a ?

    Would the following work:
    PHP Code:
    $EmailTo "info@myemailaddress.co.uk""accounts@myemailaddress.co.uk"

  2. #2
    Join Date
    Jul 2010
    Location
    Minnesota
    Posts
    256
    Thanks
    1
    Thanked 21 Times in 21 Posts

    Default

    You didn't really provide enough info to truly help you, but I am assuming you're using the mail(). So in that case you use , not ;
    Check out the php manual for it here - http://www.php.net/manual/en/function.mail.php
    PHP Code:
    $EmailTo "info@myemailaddress.co.uk""accounts@myemailaddress.co.uk" 
    You never know everything, I learn everyday!

  3. #3
    Join Date
    Aug 2009
    Location
    London
    Posts
    84
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Default

    thanks for your reply fastsol1.
    I only included the part of the php script that refers to where emails from the website contact form are directed. Here is the complete script from the contact engine if that is more helpful. I just want to add in a second email address for enquiries to be sent to.

    PHP Code:
    <?php

    $EmailFrom 
    "My Website";
    $EmailTo "info@myemailaddress.co.uk";
    $Subject "A Message From Your Website";
    $Name Trim(stripslashes($_POST['Name'])); 
    $Tel Trim(stripslashes($_POST['Tel'])); 
    $Email Trim(stripslashes($_POST['Email'])); 
    $Message Trim(stripslashes($_POST['Message'])); 

    // validation
    $validationOK=true;
    if (!
    $validationOK) {
      print 
    "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
      exit;
    }

    // prepare email body text
    $Body "";
    $Body .= "Name: ";
    $Body .= $Name;
    $Body .= "\n";
    $Body .= "Tel: ";
    $Body .= $Tel;
    $Body .= "\n";
    $Body .= "Email: ";
    $Body .= $Email;
    $Body .= "\n";
    $Body .= "Message: ";
    $Body .= $Message;
    $Body .= "\n";

    // send email 
    $success mail($EmailTo$Subject$Body"From: <$EmailFrom>");

    // redirect to success page 
    if ($success){
      print 
    "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
    }
    else{
      print 
    "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
    }
    ?>

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    2,025
    Thanks
    16
    Thanked 315 Times in 313 Posts
    Blog Entries
    13

    Default

    Try them separated with commas (in one pair of quotes);
    Code:
    $EmailTo = "info@myemailaddress.co.uk, accounts@myemailaddress.co.uk";
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  5. The Following User Says Thank You to Beverleyh For This Useful Post:

    jhatter (07-11-2014)

Similar Threads

  1. Documentation Engine?
    By X96 Web Design in forum Computer hardware and software
    Replies: 3
    Last Post: 03-26-2010, 12:23 AM
  2. Search Engine
    By afe in forum Other
    Replies: 4
    Last Post: 02-02-2008, 06:33 PM
  3. php search engine
    By peejeno in forum PHP
    Replies: 1
    Last Post: 01-31-2007, 01:40 AM
  4. Search Engine Help
    By nproser in forum HTML
    Replies: 2
    Last Post: 08-12-2005, 06:54 PM
  5. Search Engine
    By Reddish in forum HTML
    Replies: 1
    Last Post: 10-05-2004, 02:21 PM

Bookmarks

Posting Permissions

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