Mail() function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

Mail() function

Post by Calimero »

Do I need any special settings for php in order to use this function ?

I got this message returned (I don't have mail server installed, but just to ask, if I jumped over any important step):

Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in file-path... on line 147.

What does this error say - mistake in code, or just no mail server present ?

Thanks Ahead !
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

You need a mail server. Linux boxes should have sendmail, but if you're on a windows box, you don't have such a luxury. You need to install a mail server and configure it to use port 25, or configure php to use another port.
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

or you can point it to your ISP's mail server.
Post Reply