RaythMistwalker Posted January 18, 2010 Share Posted January 18, 2010 if(isset($_POST['send'])) { $to = "[email protected]"; $subject = $_POST['subject']; $name_field = $_POST['name']; $email_field = $_POST['email']; $message = $_POST['message']; $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message"; mail($to, $subject, $body); $error = 'Message Sent.'; } I'm getting no errors and it is returning the Message Sent message. I'm also not getting the email. Link to comment https://forums.phpfreaks.com/topic/188899-mail-help/ Share on other sites More sharing options...
JonnoTheDev Posted January 18, 2010 Share Posted January 18, 2010 You need to include mail headers. Look at the examples on http://uk.php.net/manual/en/function.mail.php Link to comment https://forums.phpfreaks.com/topic/188899-mail-help/#findComment-997343 Share on other sites More sharing options...
otuatail Posted January 18, 2010 Share Posted January 18, 2010 you also need to add a 5th section to your mail function like mail($to,$subject, $message, $headers, '[email protected]') // where this is your website Desmond Link to comment https://forums.phpfreaks.com/topic/188899-mail-help/#findComment-997349 Share on other sites More sharing options...
JonnoTheDev Posted January 18, 2010 Share Posted January 18, 2010 you also need to add a 5th section to your mail function like not always Link to comment https://forums.phpfreaks.com/topic/188899-mail-help/#findComment-997401 Share on other sites More sharing options...
jtgraphic Posted January 18, 2010 Share Posted January 18, 2010 Just to ask the obvious: does your sever support outgoing mail, and do you have permission to use it? Link to comment https://forums.phpfreaks.com/topic/188899-mail-help/#findComment-997407 Share on other sites More sharing options...
RaythMistwalker Posted January 18, 2010 Author Share Posted January 18, 2010 Just to ask the obvious: does your sever support outgoing mail, and do you have permission to use it? yes and yes and i already marked this as solved to show i got it working? Link to comment https://forums.phpfreaks.com/topic/188899-mail-help/#findComment-997409 Share on other sites More sharing options...
jtgraphic Posted January 18, 2010 Share Posted January 18, 2010 Sorry about that. I had that sitting in my browser and hit post before re-looking. Grats on getting it going! -JKT Link to comment https://forums.phpfreaks.com/topic/188899-mail-help/#findComment-997414 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.