Please bare with me if these questions sound so stupid! Only just learnt PHP/SQL! I am now mucking around with the mail() function in PHP:
When I execute this script, no email is received in my inbox or spam from gmail. I have searched SMTP on the forums without any success. I have a feeling I may need SMTP, but I am clueless as to what to do to get this email working.
Is there a guide to show me how to set up a mail server? I think that is what I need in order to get the email function working.
Thanks
Code:
<?php
$to = "openforum@gmail.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body))
{
echo("<p>Message successfully sent!</p>");
}
else
{
echo("<p>Message delivery failed...</p>");
}
?>
When I execute this script, no email is received in my inbox or spam from gmail. I have searched SMTP on the forums without any success. I have a feeling I may need SMTP, but I am clueless as to what to do to get this email working.
Is there a guide to show me how to set up a mail server? I think that is what I need in order to get the email function working.
Thanks