Results 1 to 3 of 3

Thread: simple php mail me

  1. #1
    Join Date
    Aug 2008
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question simple php mail me

    For some reason I'm having trouble getting a simple php form to mail me some data. Here is what I was using but have since been told that it isn't practical and needs updating:

    PHP Code:
    <script language="php"
    $email $HTTP_POST_VARS[email]; 
    $mailto "my.email@myhost.com"
    $mailsubj "Title"
    $mailhead "From: $email\n"
    reset ($HTTP_POST_VARS); 
    $mailbody "Data received:\n"
    while (list (
    $key$val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } 
    if (!
    eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto$mailsubj$mailbody$mailhead); } 
    </script> 
    Does anyone have any suggestions?

    ++ don't be put off by my lack of thanks - I don't know how to give it// but thanks anyway

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Well, you really should use $_POST instead of $HTTP_POST_VARS, of course, I don't know what that is - (I assume its the same). And also use mail headers, learn a bit more here:
    http://php.net/mail
    The "Thank you" button is write under a user's post next the Quote, and other buttons, it looks some like the button below(this one isn't the clickable one).
    Jeremy | jfein.net

  3. #3
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Yeah. Nile's right. Use the $_POST variable. Also, that site he gave you is REALLY good. There is also this one site, W3Schools, that has an okay PHP e-mail script. Here it is: PHP E-mail. Here is the secure form: PHP Secure E-mail

    -magicyte

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
  •