Send Mail problem.

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
nasf
Forum Newbie
Posts: 2
Joined: Wed Jul 06, 2005 11:58 am

Send Mail problem.

Post by nasf »

Hi ppl,

First of all, I have a free sendmail program (wich is in system path and I can send mail from the command line with no problems) in a Windows XP with Xampp 1.4.

When I try to send mail via php script it returns me an error: "mail cannot be sent because the connection to your mail server was interrupted...". Does anyone knows what's going on?

My php.ini:

...

[mail function]
; For Win32 only.
SMTP = my.smtp.server

; For Win32 only.
sendmail_from = my@email
; To send outside please use FQDN like 'sendmail_from = postmaster@localhost.org'

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

...

Thanks in advance.

NASF
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

using the correct port are you?

made sure you have the correct address for the smtp server have you?

tried another client (other than php, ie outlook) have you?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

A few possibilities:

-- The SMTP server isn't the one your ISP uses and mail relaying was denied.
-- Your SMTP server requires authentication

I can't say I've seen that exact error before however. Have you sent mail via this SMTP from this machine before using a mail program such as Outlook or Evolution?
nasf
Forum Newbie
Posts: 2
Joined: Wed Jul 06, 2005 11:58 am

Post by nasf »

I know that my ISP (SMTP and ports, included) is correct because is the same configured on Outlook and in sendmail program and they can send mail without problems.

The problem occours only when I use php mail functions!
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

First XAMPP uses mercury mailserver I believe. Are you sure the mailserver is running? Try 'telnet localhost 25' from the command line to be certain.

Also this:

[mail function]
; For Win32 only.
SMTP = my.smtp.server

needs to be the address of the mail server.In your case

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

should be good. Also you need to configure the mail server so authentication is not required from localhost.

Anyway try these two things and report back, and don't forget to restart the server after you have altered the php.ini file.
Post Reply