# Kirupa Contact Form PHP not working (sending to Yahoo)

**URL:** <https://forum.kirupa.com/t/kirupa-contact-form-php-not-working-sending-to-yahoo/325550>\
**Category:** programming\
**Created:** [October 21, 2011, 9:03pm UTC](https://forum.kirupa.com/t/kirupa-contact-form-php-not-working-sending-to-yahoo/325550 "2011-10-21T21:03:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Bullock](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@Paul\_Bullock](https://forum.kirupa.com/u/Paul_Bullock)\
**Post date:** [October 21, 2011, 9:03pm UTC](https://forum.kirupa.com/t/kirupa-contact-form-php-not-working-sending-to-yahoo/325550/1 "2011-10-21T21:03:29Z")

</div>

Hi,

I have setup up the contact form and mailer.php script, however when i submit the contact form and set the $to = to a yahoo email i do not receive any emails.

When i set it to [info@mydomainname.co.uk](mailto:info@mydomainname.co.uk) it works?

Seems like its not working for some emails?

Can anyone help or know why i cant receive them?

HTML

```auto
<form id="sendemail" method="post" action="mailer.php"> <ol> <li> <label for="name">Name (required)</label> <input type="text" name="name" class="validate[required] text" id="name" /> </li> <li> <label for="email">Email Address (required)</label> <input type="text" name="email" class="validate[required,custom[email]] text" id="email" /> </li> <li> <label for="subject">Subject</label> <input type="text" name="subject" id="subject" class="text" /> </li> <li> <label for="message">Your Message</label> <textarea value="" class="validate[required,length[6,1000]] message" name="message" id="message" rows="8" cols="50" /> </textarea> </li> <li> <input type="image" value="Submit" name="submit" id="imageField" src="images/submit.gif" class="submit" /> <div class="clr"></div> </li> </ol> </form>

```

PHP MAILER SCRIPT

```php
<?PHP $to = "name@isp.co.uk"; $subject = "Results from your Request Info form";$headers = "From: warrington-kitchen-installations.co.uk";$forward = 1;$location = "thank-you.html";
$date = date ("l, F jS, Y"); $time = date ("h:i A"); 

$msg = "Below is the result of your feedback form. It was submitted on $date at $time.

"; 
if ($_SERVER['REQUEST_METHOD'] == "POST") { foreach ($_POST as $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "
"; }}else { foreach ($_GET as $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "
"; }}
mail($to, $subject, $msg, $headers); if ($forward == 1) { header ("Location:$location"); } else { echo "Thank you for submitting our form. We will get back to you as soon as possible."; } 
?>

```

Thanks  
Paul
