# PHP email help?

**URL:** <https://forum.kirupa.com/t/php-email-help/206605>\
**Category:** programming\
**Created:** [November 9, 2006, 7:17pm UTC](https://forum.kirupa.com/t/php-email-help/206605 "2006-11-09T19:17:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rororo](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rororo](https://forum.kirupa.com/u/rororo)\
**Post date:** [November 9, 2006, 7:17pm UTC](https://forum.kirupa.com/t/php-email-help/206605/1 "2006-11-09T19:17:04Z")

</div>

Hi everyone,

I’ve created a form within flash to send using php. this is my code:

```php
<?
if(!empty($_POST['senderMail'])
    || !empty($_POST['senderMessage'])
    || !empty($_POST['senderSubject'])
    || !empty($_POST['senderName']))
{
    $to = "my@address.com"; 
    $sName = $_POST['senderName'];
    $sMail = $_POST['senderMail'];
    $subject = $_POST['senderSubject'];
    $body = $_POST['senderMessage'];
    $body .= "

---------------------------
";
    $body .= "Mail sent by: $sName <$sMail>
";
    $header = "From: $sName <$sMail>
";
    $header .= "Reply-To: $sName <$sMail>
";
    $header .= "X-Mailer: PHP/" . phpversion() . "
";
    $header .= "X-Priority: 3";
    if(@mail($to, $subject, $body, $header))
    {
        echo "output=sent";
    } else {
        echo "output=error";
    }
} else {
    echo "output=errorMain";
}
?>

```

I’m getting an error “inside” when i send the test mail. in other words, the variables are apparently being passed, but something in the middle is causing problems…

can anyone help?

thanks!
