RaythMistwalker Posted January 18, 2010 Share Posted January 18, 2010 if(isset($_POST['send'])) { $to = "myemail@domain.com"; $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. Quote 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 Quote 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, '-froot@mywebsite.com') // where this is your website Desmond Quote 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 Quote 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? Quote 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? Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/188899-mail-help/#findComment-997414 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.