I can not get the php function: mail to actually send me mail.
$to = 'firstname.lastname@example.org';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: email@example.com';
mail($to, $subject, $message, $headers);
Is there something missing or need programmed into "php.ini" for the email to work?
you have to set smtp port and smtp host in php.ini file
How do you set the SMTP port and host in the php.ini?
open php.ini file,find smtp port set 25 and smtp host is yours host like this example.com
The port setting was right. I did not have to change it: "smtp_port = 25".
I tried: firstname.lastname@example.org and just: example.com. Neither of which worked.
What is it exactly do I write into "SMTP =" in the php.ini?
write your host name ,i have given jus example.
SMTP = yoursite.net (which is your host name put that here)
I have MSN Hotmail. My email is email@example.com.
I tried putting "stmp.live.com" my incoming smtp mail from server that did not work.
Could you give some other examples of what works?
Or do you have to do something to the php.ini to initialize the new settings?
For what it's worth, I have found that some hosting providers only support the PHP mail function on UNIX servers.
I have Apache version 2.2.21 but I have never used it.
How do I restart the apache server so that PHP modules and attributes from php.ini will be reloaded.
Thank you for the help. I just needed to configure the php.ini with the correct "SMTP=smtp.mail.com" with a matching "smtp_port =25" and it works.
This topic is now closed. New replies are no longer allowed.