# How can i get a php contact form to send a welcome email?

**URL:** <https://forum.kirupa.com/t/how-can-i-get-a-php-contact-form-to-send-a-welcome-email/311565>\
**Category:** Uncategorized\
**Created:** [July 10, 2010, 10:23am UTC](https://forum.kirupa.com/t/how-can-i-get-a-php-contact-form-to-send-a-welcome-email/311565 "2010-07-10T10:23:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spindrift](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@spindrift](https://forum.kirupa.com/u/spindrift)\
**Post date:** [July 10, 2010, 10:23am UTC](https://forum.kirupa.com/t/how-can-i-get-a-php-contact-form-to-send-a-welcome-email/311565/1 "2010-07-10T10:23:01Z")

</div>

hi guys,

i have a basic php contact form that works absolutely fine.

is it possible that when the site visitor fills in the form they get an automated welcome email?

below is the code i have already…

```auto

<?php

$to = "me@myemail.com";
$subject = "MAILING LIST SIGN UP";

$email=$_POST['email'] . "
";

$message = $headers;
$message .= "Name: " . $_POST["name"] . "
";
$message .= "E-mail: " . $_POST["email"] . "
";

$url = stripslashes($_POST["url"]);
if (!empty($url)) {
header( 'Location: http://www.goaway.com' );
exit();
} 

mail($to, $subject, $message, $headers);

header( 'Location: http://www.mydomain.com/thanks.php' ) ;
?>

```

thank you very much and i hope to hear from you.

sm
