Jump to content

toker

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

toker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. toker

    mailform

    Thanx a million - just did not see it - I am a zero with php but learning it all works - great
  2. toker

    mailform

    Thanx Donald this does the trick one more question - I would like to redirect after sending to //redirect to the 'thank you' page header('Location: contact_ok.html'); now I get the sent message - how do I change this
  3. toker

    mailform

    Hi - been trying for days to get this to work but it only works half - it sends the email to info@website.com - I want to send a message to the email sender as well but - it used to work before - it just ain't going. What am I missing. <?php //create short variable names $name=$_POST['name']; $email=$_POST['email']; $subject=$_POST['subject']; $message=$_POST['message']; $name=trim($name); $email=trim($email); $subject=StripSlashes($subject); $message=StripSlashes($message); //clear the variables $name=''; $email=''; $subject=''; $message=''; if(!empty($HTTP_POST_VARS['name']) || !empty($HTTP_POST_VARS['email'])) { $to = "info@website.com"; $subject = "website name"; $body .= "\n\n"; $body .= "This email is send by: " . $HTTP_POST_VARS['name'] . " \n\n<" . $HTTP_POST_VARS['email'] . ">\n\n"; $body .= "" . $HTTP_POST_VARS['message'] . "\n"; $body .= "\n"; $header = "From: " . $HTTP_POST_VARS['name'] . " <" . $HTTP_POST_VARS['email'] . ">\n"; $header .= "Reply-To: " . $HTTP_POST_VARS['name'] . " <" . $HTTP_POST_VARS['email'] . ">\n"; $header .= "X-Mailer: PHP/" . phpversion() . "\n"; $header .= "X-Priority: 1"; if(@mail($to, $subject, $body, $header)) { "output=sent"; } else { "output=error"; } } else { "output=error"; } /////////////// $to = ($HTTP_POST_VARS['email']); $subject = "website email"; $body = "Dear " . ($HTTP_POST_VARS['name']); $body .= ","; $body .= "\n\nThank you for your email. \n\nWe will surely read it, but because we receive so many mails, the answer\nsometimes may take a couple of days.\n\nToker \n"; $body .= "\n\n"; $header .= "X-Mailer: PHP/" . phpversion() . "\n"; $header .= "X-Priority: 1"; if(@mail($to, $subject, $body, $header)) //redirect to the 'thank you' page header('Location: contact_ok.html'); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.