Jump to content

Recommended Posts

Posted

I was trying to create a comment page for visitors to my site using php. For some reason I can't get the mail() function to send mail. I've added the headers recommended by php.net users, but it still won't work. What other details do I need?

Posted

I just now tried this on my site and it worked just fine:

 

<?php
$tomail = "your-addy@yahoo.com";
$frommail = "anybody@yahoo.com";
$subject = "Test Email";
$message = "This is a test.";

mail($tomail, $subject, $message, "From: $frommail");
echo "The email has been sent.";
?>

 

Make sure you check your spam folder.

 

Byron

 

 

Posted

Tell us which email account you using?

 

I'm currently using yahoo, by adding stevie.heliohost.org into trusted list.

My hotmail used to receive mail too, but not now.

Problem : unknown

Posted

I'm using a gmail account for the receiving address. Will certain mail accounts not receive properly?

This is the code i used to test the mail function:

 

<?php

$sendto = "myemail@gmail.com";
$subject = "Subject";
$from = "nobody@nowhere.edu";
$headers = 'From: '.$from."\r\n".'Reply-To: '.$from."\r\n";
$body = "This will work. I insist upon it. \r\n";
mail( $sendto, $subject, $body, $headers );

echo "it worked";

?>

Posted

Like Byron said, check your Spam folder.

I'm not sure about gmail since i'm not using it.

Add stevie.heliohost.org into trusted list as I do in yahoo mail.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...