Simpe PHP Form Process Problem

Discussion in 'PHP' started by jehzlau, Apr 17, 2007.

  1. #1
    Hi, i created a PHP form, and I have a simple newbie question of how to send a notification to the one who filled up the form. Please do help me :(

    This is my sample php code:

    
    
    $Name =  $_POST['Name'];
    $Email =  $_POST['Email'];
    $Message = $_POST['Message];
    
    $header = "Blah Blah";
    $subject = "Blah Blah";
    $email_to = "blah@blah.com";
    $message= "Name: $Name 
    E-mail: $Email $
    Message: $Message";
    
    // Send the form to me
    @mail($email_to, $subject ,$message ,$header ) ;
    
    
    Code (markup):
    That's my php code, but i can't figure it out how to send a confirmation message to the sender.. :( I know this is pretty easy, but I suck as it... I can make it work :(

    I tried this one:

    $header2 = "Blah Blah";
    $subject2 = "Blah Blah";
    $email_to2 = "$Email";
    $message2= "Name: $Name 
    
    @mail2($email_to2, $subject2 ,$message2 ,$header2 ) ;
    Code (markup):
    But it doesn't work :(
     
    jehzlau, Apr 17, 2007 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    headers need to be properly formatted, heres an example of some properly formatted headers

    
    <?php
    		$headers = 	"Content-type: text/html\r\n".
    					"From: Your Name <you@you.com>";
    
    PHP:
    additionally most servers require that the <from> email address is an existing email address associated with your domain name, unless you have catch all emails setup.
     
    krakjoe, Apr 17, 2007 IP
  3. jehzlau

    jehzlau Active Member

    Messages:
    301
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #3
    OOoooooooh... i will just add it to the headers! ThanksssssSS Il try it out :)
     
    jehzlau, Apr 17, 2007 IP
  4. jehzlau

    jehzlau Active Member

    Messages:
    301
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #4
    What about the personalized message? how can I put that to be sent to the one who filled up the form?

    For instance

    $messageforthesender = "Thank you for completing the form"

    then send to the $Email of the sender...

    Is that easy? :(
     
    jehzlau, Apr 17, 2007 IP
  5. jehzlau

    jehzlau Active Member

    Messages:
    301
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #5
    Thanks, it works!

    Another question...

    How can I make the font weight of the message text to be bold

    what I did is

    $message= "<b>Sample Message</b>";
    Code (markup):
    But it doesn't work... need help :(
     
    jehzlau, Apr 17, 2007 IP
  6. chuckd1356

    chuckd1356 Active Member

    Messages:
    770
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    70
    #6
    chuckd1356, Apr 17, 2007 IP
  7. jehzlau

    jehzlau Active Member

    Messages:
    301
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #7
    sorry.. :( and thanks for that very helpful link :)
     
    jehzlau, Apr 17, 2007 IP