philosophaie — 2012-03-05T23:59:01-05:00 — #1
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?
goldensona — 2012-03-06T00:08:07-05:00 — #2
you have to set smtp port and smtp host in php.ini file
philosophaie — 2012-03-06T00:24:15-05:00 — #3
How do you set the SMTP port and host in the php.ini?
goldensona — 2012-03-06T00:32:06-05:00 — #4
open php.ini file,find smtp port set 25 and smtp host is yours host like this example.com
philosophaie — 2012-03-06T00:55:35-05:00 — #5
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?
goldensona — 2012-03-06T01:01:20-05:00 — #6
write your host name ,i have given jus example.
SMTP = yoursite.net (which is your host name put that here)
philosophaie — 2012-03-06T01:07:24-05:00 — #7
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?
goldensona — 2012-03-06T01:31:53-05:00 — #8
bob42 — 2012-03-06T09:12:42-05:00 — #9
For what it's worth, I have found that some hosting providers only support the PHP mail function on UNIX servers.
philosophaie — 2012-03-06T13:21:33-05:00 — #10
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.
goldensona — 2012-03-08T23:10:26-05:00 — #11
philosophaie — 2012-03-08T23:56:31-05:00 — #12
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.