Failed to connect to mailserver

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
irwin
Forum Newbie
Posts: 1
Joined: Mon Aug 07, 2006 5:04 pm

Failed to connect to mailserver

Post by irwin »

Hi, I'm new to php. When I click "Confirm Order"on my 'practice' shopping cart I get this error

Code: Select all

Warning: mail() [function.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 C:\Program Files\xampp\htdocs\catalog\includes\classes\email.php on line 522

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\catalog\includes\classes\email.php:522) in C:\Program Files\xampp\htdocs\catalog\includes\functions\general.php on line 33
can someone help? Thanks.


hawleyjr | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Do you have an SMTP server running on that computer? You need to edit php.ini to tell it where your smtp server is ;)
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

The first error is saying you can't use the mail function because your mail server is not setup on your server or in your ini file. You can search this forum for alternative ways to send mail.

The second error message was created because the first error message outputted to the browser.
Post Reply