Cant send a simple email... Mail() function always fails
Posted: Thu Apr 12, 2007 3:03 pm
feyd | Please use
Is there some setting in php.ini file or something I need to change?
Also im sure the emails are not being sent to my junk folder or anything else, I have checked... but the else (Mail send failure) statement is always executed so the emails are not sending at all.
this should be easy... right???
any help is greatly appreciated!
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hey...
This seems to be something incredibly easy, but I have tried the sample scripts from many sites and I cant get any of them to send an email from my php page.
Heres the code im using.Code: Select all
<?php
$to = 'oneOfMyEmails@gmail.com';
$subject = 'the subject';
$from = 'anotherOneOfMyEmails@hotmail.com';
$message = 'hello';
if(mail($to, $subject, $message, "From: $from"))
echo "Mail sent"; // this never gets called
else
echo "Mail send failure - message not sent"; // this error always happens
?>Also im sure the emails are not being sent to my junk folder or anything else, I have checked... but the else (Mail send failure) statement is always executed so the emails are not sending at all.
this should be easy... right???
any help is greatly appreciated!
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]