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( "[email protected]", "Feedback Form Results",
    $message, "From: $email" );
  header( "Location: http://www.example.com/thankyou.html" );
?>

 

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

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" );
}
?>

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.