Jump to content

[SOLVED] please help me with my mail php - going nuts


toker

Recommended Posts

want to use a php script (works partially - sends a message to my inbox) but want it to work also to send a message to the sender. like, 'thank your for your email - we will reply usually within 2 days.'

 

I am a dummy when it comes to this and been trying to see the catch but nothing works.

 

anybody with some time to kill for a helping hand in this darkness?

 

 

<?

if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_subject']) || !empty($HTTP_POST_VARS['sender_name']))

{

  $to = "[email protected]";

  $subject = stripslashes($HTTP_POST_VARS['sender_subject']);

  $body = stripslashes($HTTP_POST_VARS['sender_message']);

  $body .= "\n\n---------------------------\n";

  $body .= "Mail sent by: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail']  . ">\n";

  $header = "From: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";

  $header .= "Reply-To: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";

  $header .= "X-Mailer: PHP/" . phpversion() . "\n";

  $header .= "X-Priority: 1";

  if(@mail($to, $subject, $body, $header))

  {

      echo "output=sent";

  } else {

      echo "output=error";

  }

} else {

  echo "output=error";

}

?>

If i have understood you correctly then you can think in this way also.....

 

you can call mail() second time with $to changed with $from and $from with $to and change the $body content.create two function

 

sendmailtoAdmin($to,$from)

sendmailtoCosumer($to,$from)

 

in both function define your $body accordingly and call both the funtions one after another.

 

Regards

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.