Email() wont work?

<?php
$to = "electrifiedpete@gmail.com";
$subject = "Hi!";
$body = "Hi,

How are you?";
if (mail($to, $subject, $body)) {
  echo("<p>Message successfully sent!</p>");
 } else {
  echo("<p>Message delivery failed...</p>");
 }
?>

I run it but the Email never arrives and it is not in the spam box either???

It is probably being blocked by the server because you haven’t included any headers. The receiving mail server likely thinks that the message is blatant spam, and won’t let it thru.

I had good success looking at the comments in the php.net page for mail() to get some more robust functionality

OK thanks!

Switch to PEAR mail. Overall just better :smiley:

Unless you need to develop in an environment where it is not installed.