PHP mail trouble

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
scottae
Forum Newbie
Posts: 5
Joined: Thu May 01, 2003 7:12 pm
Location: Atlanta, Ga.

PHP mail trouble

Post by scottae »

I am trying to follow a basic tutorial on how to send mail using PHP and I got this error message:

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\Apache Group\Apache2\htdocs\pma24_code\9\listing9.12.php on line 24

Anyone have any suggestions??? :)
Doolittle
Forum Newbie
Posts: 19
Joined: Sun May 04, 2003 11:45 pm

Post by Doolittle »

You're not running a mailserver on that server... You need to check out the php.ini file and give it a mail server to mail from :)
scottae
Forum Newbie
Posts: 5
Joined: Thu May 01, 2003 7:12 pm
Location: Atlanta, Ga.

Post by scottae »

Well, I am not sure how it needs to be configured. This is what I have in my php.ini file now where it talks about the mail stuff:
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Syslog]
; Whether or not to define the various syslog variables (e.g. $LOG_PID,
; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In
; runtime, you can define these variables by calling define_syslog_variables().
define_syslog_variables = Off

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = enders902@charter.net

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

What do I need to change? :roll:
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Code: Select all

SMTP = localhost
localhost is not the mail server is it? Use whatever you use with Outlook.

If you where using the same ISP as me, it would be as following:

Code: Select all

SMTP = smtp.telus.net
scottae
Forum Newbie
Posts: 5
Joined: Thu May 01, 2003 7:12 pm
Location: Atlanta, Ga.

Post by scottae »

That was the problem.........thank you for your help. :D
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

no problem :)
Post Reply