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 = "henk@seriousseeds.com";

  $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";

}

?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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