Getting Email to Work - PHP

Status
Not open for further replies.

openforum

New Member
Messages
6
Reaction score
0
Points
0
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:

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
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
There may be a problem with sending mail for some accounts right now. I am waiting for a staff reply on this issue. I will try to update you on the situation if no public announcement is made.
 

adamparkzer

On Extended Leave
Messages
3,745
Reaction score
81
Points
0
Our head administrator has been alerted of the issue and is currently working to find a solution to the problem.
 
Status
Not open for further replies.
Top