error when sending email

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
alexmaster_2004
Forum Commoner
Posts: 35
Joined: Wed Sep 14, 2005 8:44 am

error when sending email

Post by alexmaster_2004 »

Hi
I don't know if this is the right place to ask my question or not.
but i hope that anyone could help me.
ok..my problem is:
i have a pc running windowsXP_SP2 and i use PHP 4.3.11 and utilize
the Apache server 3.33.when i try to use the mail() function i get error like this:
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()
i don't know what i should do in the php.ini to make it run.
please anyone could help me.
Thanks in Advance
User avatar
trukfixer
Forum Contributor
Posts: 174
Joined: Fri May 21, 2004 3:14 pm
Location: Miami, Florida, USA

Post by trukfixer »

I think you need to specify a mail server and user/pass for same - windows , I believe, does not have any native "sendmail" - so you need to set up a mail server on windows, or connect to a remote SMTP server .. I might recommend instead to use the phpmailer class http://sourceforge.net/projects/phpmailer/

Bri!
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

Windows XP Pro has a SMTP server that's part of IIS:
http://www.webwizguide.com/asp/tutorial ... XP_pro.asp

Might also use something like something like Richard Heyes SMTP Class:
http://www.phpclasses.org/browse/package/346.html
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

In the php.ini is a section for defining your SMTP server - you can probably use the one your ISP told you to use in your normal mail program. You shouldn't really need to setup your own SMTP server.

Mac
Post Reply