# Have PHP form mail but would like to also send an thank you e-mail at the same time?

**URL:** <https://forum.kirupa.com/t/have-php-form-mail-but-would-like-to-also-send-an-thank-you-e-mail-at-the-same-time/51505>\
**Category:** Uncategorized\
**Created:** [May 13, 2004, 2:54pm UTC](https://forum.kirupa.com/t/have-php-form-mail-but-would-like-to-also-send-an-thank-you-e-mail-at-the-same-time/51505 "2004-05-13T14:54:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sany](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sany](https://forum.kirupa.com/u/Sany)\
**Post date:** [May 13, 2004, 2:54pm UTC](https://forum.kirupa.com/t/have-php-form-mail-but-would-like-to-also-send-an-thank-you-e-mail-at-the-same-time/51505/1 "2004-05-13T14:54:09Z")

</div>

I have succefully managed to complete this tutorial for a subscribe.php file linked to a page on my flash site.

\<?  
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 = “subscribe @ address”;  
$subject = stripslashes($HTTP\_POST\_VARS[‘sender\_subject’]);  
$body = stripslashes($HTTP\_POST\_VARS[‘sender\_message’]);  
$body .= "

* * *

";  
$body .= “Mail sent by: " . $HTTP\_POST\_VARS[‘sender\_name’] . " \<” . $HTTP\_POST\_VARS[‘sender\_mail’] . "\>  
";  
$header = “From: " . $HTTP\_POST\_VARS[‘sender\_mail’] . " \<” . $HTTP\_POST\_VARS[‘sender\_mail’] . "\>  
";  
$header .= “Reply-To: " . $HTTP\_POST\_VARS[‘sender\_mail’] . " \<” . $HTTP\_POST\_VARS[‘sender\_mail’] . "\>  
";  
$header .= “X-Mailer: PHP/” . phpversion() . "  
";  
$header .= “X-Priority: 1”;  
if(@mail($to, $subject, $body, $header))  
{  
echo “output=sent”;  
} else {  
echo “output=error”;  
}  
} else {  
echo “output=error”;  
}  
?\>

How and where would I be able to add some code to also send an automated “thank you for your subscription” with standard text in the body and a URL to for those who wish to unsubscribe? All coming from the same e-mail account as the TO:subscribe@e-mailaddress above?

Any help or pointers would be greatly appriciated.

Thanks

Sany
