# Form Not Emailing/Submiting

**URL:** <https://forum.kirupa.com/t/form-not-emailing-submiting/304661>\
**Category:** programming\
**Created:** [February 11, 2010, 12:37pm UTC](https://forum.kirupa.com/t/form-not-emailing-submiting/304661 "2010-02-11T12:37:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drummer392](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@drummer392](https://forum.kirupa.com/u/drummer392)\
**Post date:** [February 11, 2010, 12:37pm UTC](https://forum.kirupa.com/t/form-not-emailing-submiting/304661/1 "2010-02-11T12:37:53Z")

</div>

I have a form that should send to my email address (as it has always done in the past with the same form), but for some reason it is not at all.

Is there something wrong with my code, or my hosting service. I have used this code before with the same hosting services for a while now.

```php

if(isset($_POST['submit'])) {

$to = myemail@yahoo.com
$body = "";

foreach($_POST as $name => $value)
{
   $body .= "$name: $value";

mail($to, $subject, $body); 
}
} 

```
