SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    some place south
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    easy php email question.

    Hi,

    i have script which will process a html form and send it to my email address but how do i make it 'cc' or send a copy back to the person that filled in the form. ie one email comes to me and one to the form er filler inner.

    this is my code so far...

    <?php


    $ToEmail = "my@email.com";
    $ToSubject = "Reservation request";

    $EmailBody = "CUSTOMERS NAME: " . $FirstName .' '. $SurnameName . "\nTITLE: " . $Title . "\nORGANIZATION: " . $CompanyOrg . "\nCUSTOMERS ADDRESS: " . $StreetAddress .' '. $Address2 .' '. $TownOrCity .' '. $County .' '. $PostCode . "\nTELEPHONE NUMBER, HOME: " . $HomePhone . " MOBILE: " . $MobilePhone . "\nFAX NUMBER: " . $FaxNumber . "\nCUSTOMERS EMAIL: " . $EmailAddress . "\nNUMBER OF GUESTS: " . $Guest . "\nREQUESTED RESERVATION DATE: " . $Date . "\nREQUESTED TIME: " . $Time;


    $EmailFooter="\n\nThis message was sent from http://www.MyDomain.com";



    $Message = $EmailBody.$EmailFooter;

    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName .' '. $SurnameName . " <".$EmailAddress.">");
    ?>



    thanks for any helpers. im sure is an easy one. im just new to it all.


    thanks again

    B.

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That should do the trick
    Code:
    mail("$ToName <$ToEmail>", $ToSubject, $Message, "From: $FirstName $SurnameName <$EmailAddress>\nCC: $FirstName $SurnameName <$EmailAddress>");

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    some place south
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dont think thats working anybody else?

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    some place south
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry to offend you. I put the code in EditPlus and all the colours looked odd. ill give it a go fully now.

    Sorry.

  5. #5

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oops, played too much with the edit feature and deleted my previous posting by accident .... anyway, it needs to be case sensitve btw
    PHP Code:
    "\nCc: $FirstName

  6. #6
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    some place south
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i got it working ish. using mail("$ToName <$ToEmail>", $ToSubject, $Message, "From: $FirstName $SurnameName <$EmailAddress>\nCc: $FirstNameA $LastNameA <$EmailAddress>");

    note Cc lower.

    but in the both email as send its not the name? it show email address. ah hang on ive got FirstNameA in my form ill try changig that.

    Thanks for the help.

  7. #7
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    some place south
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep all working now that was it.

    cheers.

    Sorry for doubting you earlier

  8. #8

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bencallaway_uk
    Sorry for doubting you earlier
    Never mind, happened to all great men in history .


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
  •