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.

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.   Paste as plain text instead

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