Click to See Complete Forum and Search --> : mail() function setup


AEinstein
08-05-2004, 10:43 PM
I am running Windows XP and just using it as a test computer for PHP. I am getting an error when running a script from my book:
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 C:\Apache\htdocs\feedback.php on line 12

here's a copy of my php.ini file from the [mail function] section:
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = NULL

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


any help would be much appreciated :)

LordShryku
08-05-2004, 11:41 PM
Point it to a valid SMTP server. Just like when setting up an email client.

Otherwise, you have to install a MTA, which is going to be quite a bit harder.

AEinstein
08-06-2004, 01:33 AM
Originally posted by LordShryku
Point it to a valid SMTP server. Just like when setting up an email client.

Otherwise, you have to install a MTA, which is going to be quite a bit harder.

i dont know how to do that >.< I'm still mass noobie. would a valid smtp server be like my yahoo mail server?

LordShryku
08-06-2004, 02:27 AM
Don't know that yahoo provides SMTP support, but if you have a non-free web based thing, like an email address from your ISP, they should have given you the SMTP server. It would probably be mail.server.com or smtp.server.com.

AEinstein
08-06-2004, 08:49 PM
Originally posted by LordShryku
Don't know that yahoo provides SMTP support, but if you have a non-free web based thing, like an email address from your ISP, they should have given you the SMTP server. It would probably be mail.server.com or smtp.server.com.

oo kk, my isp is yahoo dsl and my email is a pacbell.net accnt. i think i've seen a smtp address from them, i'll check up on it. thank you for ur help


*EDIT*I found the smtp server. smtp.pacbell.yahoo.com. now when i run the script, it gives me an error b/c it requires authentication.
Plz help me configure it for it to include authentication no.

tsinka
08-07-2004, 04:55 AM
Hi,

the mail function doesn't support authentication itself. Try to use a mail class like

phpmailer (http://phpmailer.sourceforge.net/)

Thomas