# Help Needed - simple PHP email

**URL:** <https://forum.kirupa.com/t/help-needed-simple-php-email/259136>\
**Category:** programming\
**Created:** [May 1, 2008, 12:10pm UTC](https://forum.kirupa.com/t/help-needed-simple-php-email/259136 "2008-05-01T12:10:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![korpela2](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@korpela2](https://forum.kirupa.com/u/korpela2)\
**Post date:** [May 1, 2008, 12:10pm UTC](https://forum.kirupa.com/t/help-needed-simple-php-email/259136/1 "2008-05-01T12:10:42Z")

</div>

Hi,

Any help one the following problem would be much appreciated.

Im sending an email through PHP that is triggered by a flash application. The code worked fine until I tried incorporating a random nuber into the email.

My code is:

```
  &lt;?

  [COLOR=Blue]$numb = rand();[/COLOR]

  $ToEmail = "---@gmail.com";

  ##$ToName = "Player 1";
  $ToSubject = "Game results";

   $ip= $REMOTE_ADDR;

   $EmailBody = "Player's Name: $FirstName

```

Player’s Email: $Email

Chosen Charity: $ToCharity  
Pplayer’s IP address: $ip

[COLOR=Blue]Redemtion Code: $numb[/COLOR]";

```
   $EmailFooter="

```

This message was sent by: ---------. If you feel that you recieved this e-mail by accident please contact me at ---------";

```
   $Message = $EmailBody.$EmailFooter;

    mail($ToName." &lt;".$ToEmail."&gt;",$ToSubject, $Message, "From: ".$FirstName." &lt;".$Email."&gt;");

   ?&gt;

```

The areas marked with [COLOR=Blue]blue[/COLOR] are not allowing the email to be sent. The answer is probably simple, but being new to PHP doesn’t help me much…
