matt.sisto Posted April 1, 2009 Share Posted April 1, 2009 Hello, I am trying to get my mail script to send reply to the mail sender when the message is sent. messageTechnical.php <?php require "dbconn2.php"; $from = $_POST['email']; $sender = $_POST['name']; $message = $_POST['content']; $to = '[email protected]'; $headers = "SRC Message From: $from"; $footers = "Salmons Reach Consultancy. Striving to achieve excellence."; if (!preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+[a-z]{2}/is', $from)){ header("Location: error.php"); exit(); } if (preg_match("/http:\/\//i", $from)){ header("Location: error.php"); exit(); } if (preg_match("/http:\/\//i", $sender)){ header("Location: error.php"); exit(); } if(preg_match("/http:\/\//i", $message)){ header("Location: error.php"); exit(); } mail($to, $sender, $message, $headers); header("Location: replyTechnical.php"); exit(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>?Message Technical Support</title> </head> <body> </body> replyTechnical.php: <?php require "dbconn2.php"; $to = $_POST['email']; $sender = '[email protected]'; $headers = "SRC: Technical Support"; $message = "We value your patience, and will try to get back to you asap. Thanks and Regards, SRC Technical Support Team"; mail($to, $sender, $message, $headers); header("Location: technical.php"); exit(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Technical Reply</title> </head> <body> </body> I have echoed out the value of the variables and there is an issue with passing the email value. Any help appreciated. Link to comment https://forums.phpfreaks.com/topic/152068-solved-automating-a-reply-to-mail/ Share on other sites More sharing options...
matt.sisto Posted April 1, 2009 Author Share Posted April 1, 2009 Is it possible to pass variable values from script to script? and how. I was thinking: $to = $_GET ['$from']; Link to comment https://forums.phpfreaks.com/topic/152068-solved-automating-a-reply-to-mail/#findComment-798606 Share on other sites More sharing options...
premiso Posted April 1, 2009 Share Posted April 1, 2009 header("Location: replyTechnical.php?to={$to}"); Then on the replyTechincal.php $to = isset($_GET['to'])?$_GET['to']:null; Link to comment https://forums.phpfreaks.com/topic/152068-solved-automating-a-reply-to-mail/#findComment-798642 Share on other sites More sharing options...
matt.sisto Posted April 1, 2009 Author Share Posted April 1, 2009 I have sorted it now thank you, I passed it through the url: header("Location: replyMessage.php?from=$from"); $from = $_GET['from']; Link to comment https://forums.phpfreaks.com/topic/152068-solved-automating-a-reply-to-mail/#findComment-798650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.