Ill try to help. Can you post your code that isnt working? thx.
If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.
Register Today on DNForum IT'S FREE!The PHP mail() function does not work on my server. I need somebody that is familiar with pHP installations and debugging to help me figure out what is wrong.
Please give me your price to help.
Thank you.
-Bob
. . .
Ill try to help. Can you post your code that isnt working? thx.
The mail function simply does not work. Here is the entire code that I am using:
<?php
$recipient = "syates88@hotmail.com";
$subject = "Test from PHP";
$message = "Testing mail body";
mail("$recipient","$subject","$message");
?>
< html>< head>< title>< /title>< /head>
< body>
Testing mail via pHP< br>< br>
recipient: < ?php echo "$recipient"; ?>< br>
subject: < ?php echo "$subject"; ?>< br>
message: < ?php echo "$message"; ?>< br>
< /body>< /html>
NOTE: I put a space after the html tags so they woudl display correctly here. . .
I get no errors. The HTML displays fine with no PHP warnings.
In the php.ini file, the path to sendmail it correctly defined.
-Bob
. . .
if you put
$result = mail("$recipient","$subject","$message");
what does $result return? true or false?
from php.net comments on the mail() function...
perhaps this is the cause of your problems...This is a problem I ran into that really had me stumped for awhile.
I was using mail() to send messages from a bulletin board I created via a form in order to keep users email addresses private (read no email mining possible). Problem was some people were not getting the messages. After testing on MANY different email accounts I was beginning to get stumped.
It seems that some ISP's and servers require that the Return-Path header email address match the From email address in order for it to be passed onto the users account. By adding
-f email@address.com
as the last parameter in the mail function to the same as the From address everything started getting recieved as it should. Here's two examples.
mail($to, $subject, $body, $from);
resulted in some people not receiving the message.
but...
mail($to, $subject, $body, $from, "-f $from_email_address");
everyone got the message as intended.
Hope this helps someone else out as it had me totally baffled until I started comparing the full headers of my email messages.
Ciq: I tried that previously and it was not returning ANYTHING..Originally posted by Ciqala
if you put
$result = mail("$recipient","$subject","$message");
what does $result return? true or false?
At any rate, the problem was SOLVED.
The path to sendmail in the php.ini file was /usr/sbin/sendmail.
Apparantly, it needed the -t -i switches. All is good in mailville now
-Bob
. . .
cool 8)
you dont have a $from variable..?
I am also having some issues with my PHP mail from and tried this solution but had no luck. Wondering if you could help?
We can help you in that. Could you give me your contact information so we can talk about it easily. Hoping to hear from you!
Regards,
Bernadette
You guys do know that this was a 8 year old thread.
Bookmarks