Jump to content

[SOLVED] mail not received


heathergem

Recommended Posts

Here's the code. As simple as it gets.

 

<?
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;

  mail( "user@mail.com", "Feedback Form Results",
    $message, "From: $email" );
  header( "Location: http://www.example.com/thankyou.html" );
?>

 

I haven't tried debugging. How do I do that?

Link to comment
Share on other sites

Make sure your server supports mailing... that could be a problem..

 

and try this too

 

<?php
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

$mail_it = mail( $email, "Feedback Form Results", $message, "From: $email" );

if (!mail_it)
{
   // This saves to time from having to check your email/db over and over
   die("The mail hasnt been sent");
}
else
{
   header( "Location: http://www.example.com/thankyou.html" );
}
?>

Link to comment
Share on other sites

OK, that's a bit of information you didn't provide previously. Did you try the code Wes provided? If you do not get an error then the problem is most likely external to PHP. For example the outgoing or receiving email servers may be blocking the email thinkin it is spam. Or perhaps the email client is flagging the email as spam.

 

If that code does report the error "The mail hasnt been sent" [sic], then you need to look to the server/PHP implementation.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.