Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38

Thread: Form help

  1. #21
    Join Date
    Oct 2006
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thank you it worked!!

    I did get the confirmation email in my inbox, however is there a way I can get it to say it's coming from a specific email address? The one it's coming from seems like some default email address of the server or something.

  2. #22
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    The email that it's going to be sent from is here:
    Code:
    mail($emailaddress, $auto_subject, $auto_body, $to);
    You can try hard-coding an email address and see if that changes anything. There might be some settings with your mail server that are preventing that though.

    You would hard-code it like so:
    Code:
    mail($emailaddress, $auto_subject, $auto_body, "me@myemail.com");

  3. #23
    Join Date
    Oct 2006
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hi there,

    I tried both and neither work, they only affect the email address that shows up in the body of the email, not the email address it's actually coming from..

  4. #24
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    It must be your PHP settings then. You'll have to go into your php.ini file (your server admin would have access to this) and change it there.

  5. #25
    Join Date
    Oct 2006
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I asked and unfortunately it was mentioned I'd probably have to change my coding

  6. #26
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    I'm sorry...
    I just realized I was making a small mistake.

    PHP Code:
    $headers 'From: webmaster@example.com';
    mail($emailaddress$auto_subject$auto_body$headers); 
    That should work.
    I've been using some PHP frameworks lately where the syntax is different.

  7. #27
    Join Date
    Oct 2006
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    It worked!! Thank you so much

  8. #28
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Glad it worked

  9. #29
    Join Date
    Oct 2006
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Ok this is my final question (seriously)...on the page where you can sign up and refer a friend, I have it so that when you click submit you get an automated email in your mailbox, can I have the same script in the same coding to send an automated email to the person that you referred it to as well?

    PHP Code:
    <?php


    $yourname 
    $_POST['yourname'];
    $youremail $_POST['youremail'];
    $friendsname $_POST['friendsname'];
    $friendsemail $_POST['friendsemail'];


       
    $to "company@rogers.com";   
       
    $subject "Club Form-Refer A Friend";   
       
    $body "Your Name: ".$yourname."\r\n\r\n";
       
    $body .= "Your Email: ".$youremail."\r\n\r\n"
       
    $body .= "Friend's Name: ".$friendsname."\r\n\r\n";
       
    $body .= "Friend's Email: ".$friendsemail."\r\n\r\n";

     
       
    $from $youremail;

    mail($to$subject$body$from); 

    $auto_subject "Thanks for Referring A Friend!";
    $auto_body "Thank you for referring a friend to The Club.  They will receive monthly emails about our upcoming features!";
    $headers 'From: boss@company.ca';
    mail($youremail$auto_subject$auto_body$headers); 

     
    header("Location: http://www.mysiteca/thankyourefer.htm"); 
      exit;

    ?>
    Apart from what I already have above, I want another email to go the the person that was referred to say "So and so thought you might be interested in The Club and has referred you, etc. etc."

  10. #30
    Join Date
    Oct 2006
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Do you think I can just add another mail function right underneath the previous one?

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
  •