2010-05-21 00:15:31 IST
Hi,
How do I adjust: the below so that when I receive an email the email address of the user is the From email address. When I receive an email from johndoe@xyz.com I want to be able to hit reply and for johndoe@xyz.com to be in the to field.
THANKS!!!!!
<?php
$where_form_is="http://".$_SERVER.strrev(strstr(strrev ($_SERVER),"/")); session_start(); if( ($_SESSION==$_POST ) && (!empty($_POST)) ) { mail("support@mysite.com","Website Query","Website Query: First Name: " . $_POST . " Last Name: " . $_POST . " Your Email: " . $_POST . " Type Of Query: " . $_POST . " Subject: " . $_POST . " Your Message: " . $_POST . " "); include ("confirm.html"); } else { echo "Invalid Captcha String. Please click back and re-enter the characters in the image. Thanks "; } ?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks but how do I integrate it in my code? The from email relates to field 3. Complete Newbie to this stuff. My code is that in the processor.php file.
Any ideas please?
2010-05-21 00:15:31 IST
Hi,
How do I adjust: the below so that when I receive an email the email address of the user is the From email address. When I receive an email from johndoe@xyz.com I want to be able to hit reply and for johndoe@xyz.com to be in the to field.
THANKS!!!!!
<?php
$where_form_is="http://".$_SERVER.strrev(strstr(strrev ($_SERVER),"/")); session_start(); if( ($_SESSION==$_POST ) && (!empty($_POST)) ) { mail("support@mysite.com","Website Query","Website Query: First Name: " . $_POST . " Last Name: " . $_POST . " Your Email: " . $_POST . " Type Of Query: " . $_POST . " Subject: " . $_POST . " Your Message: " . $_POST . " "); include ("confirm.html"); } else { echo "Invalid Captcha String. Please click back and re-enter the characters in the image. Thanks "; } ?>
http://php.net/manual/en/function.mail.php
Example #2 Sending mail with extra headers.
Thanks but how do I integrate it in my code? The from email relates to field 3. Complete Newbie to this stuff. My code is that in the processor.php file.
Any ideas please?
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
Can I do something like: Totally guessing here
$where_form_is="http://".$_SERVER.strrev(strstr(strrev ($_SERVER),"/")); session_start(); if( ($_SESSION==$_POST ) && (!empty($_POST)) ) { mail("support@mysite.com","Website Query","Website Query: First Name: " . $_POST . " Last Name: " . $_POST . " Your Email: " . $_POST . " Type Of Query: " . $_POST . " Subject: " . $_POST . " Your Message: " . $_POST . " "); include ("confirm.html"); } else { echo "Invalid Captcha String. Please click back and re-enter the characters in the image. Thanks "; } $headers = 'Reply-To: ' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($headers);
?>
Thanks to apalachian on another thread. The below from field code works perfect now for me. What an ordeal!
note:my email field is field_3 so customise urs accordingly.
<?php**
$f_rom_em_ail = $_POST;
$headers = 'From: ' . $from_email . "\r\n" . 'Reply-To: ' . $from_em__**__ail___;_
$where_form_is="http://".$_SERVER.strrev(strstr(strrev($_SERVER),"/"));
session_start();
if( ($_SESSION==$_POST) && (!empty($_POST)) ) {
mail("support@mysite.com","Website Customer Query","Customer Query:
First Name: " . $_POST . "
Last Name: " . $_POST . "
Your Email: " . $_POST . "
Type Of Query: " . $_POST . "
Subject: " . $_POST . "
Your Message: " . $_POST . "
"$headers);
includ_e("confirm._html");
}
el_se {
echo "_Invalid Captcha String.";
}
?>
The additional lines are :
$from_email = $_POST;
$headers = 'From: ' . $from_email . "\r\n" . 'Reply-To: ' . $from_email;
and
,$headers
OOPs include the comma before headers so its ",$headers);