mail() problem
Posted: Sat Oct 26, 2002 1:04 am
Like many I seem to be having problems with mail().
If I try to send a simple message, it works, but it arrives from "root@myserver.myhost.com".
I tried to get around this by plugging in the userid and SMTP settings I use for my email account:
ini_set("sendmail_from","user@mywebsite.com");
ini_set("SMTP","myserver.myhost.com");
phpinfo(); // looks ok
mail("sometest@hotmail.com", "My Subject", "Line 1\nLine 2\nLine 3");
BUT this doesn't work.
Also, one thing I don't get about this is what about the password? When I set up an email account in my email software, I need to supply a userid and password. mail() doesn't seem to allow for this, but everyone (except me) seems to be using it successfully. Can someone fill me in on how this works?
Thanks.
If I try to send a simple message, it works, but it arrives from "root@myserver.myhost.com".
I tried to get around this by plugging in the userid and SMTP settings I use for my email account:
ini_set("sendmail_from","user@mywebsite.com");
ini_set("SMTP","myserver.myhost.com");
phpinfo(); // looks ok
mail("sometest@hotmail.com", "My Subject", "Line 1\nLine 2\nLine 3");
BUT this doesn't work.
Also, one thing I don't get about this is what about the password? When I set up an email account in my email software, I need to supply a userid and password. mail() doesn't seem to allow for this, but everyone (except me) seems to be using it successfully. Can someone fill me in on how this works?
Thanks.