Click to See Complete Forum and Search --> : mail error using external smtp server


Anon
11-08-2000, 01:04 PM
i'm not able to make work the mail function on my nt workstation with external smtp server.
if i set the php.ini smtp parameter to 'localhost' and start a smtp server, all work fine.
but if i try to send a mail through my ISP mail server i only obtain a 'server error' on the line of the mail function.
i tried both with the name and the ip address of the smtp server.
i have tried to put a fourth blank parameter in the function, as read in another thread, but it doesn't work.
i've tried with Apache, with Omnihttpd and Sambar, with the same result, so i think that it not depend from the webserver.

i'm using php 4.0.3pl1

there is something that i can do or it's a php bug?

many thanks

Anon
11-08-2000, 05:41 PM
Sounds like a spam prevention configuration setting on your ISP to me, not a bug in PHP.

I'd contact your ISP and ask them how to do it.

Anon
11-09-2000, 11:45 AM
that is not possible, because when i use my local smtp server it acts only as relay service, and forward all the mails to the SMTP server of my ISP.
so if the problem depends from antispam rules on the ISP SMTP server, it should reject also the mails transimitted from the local smtp server.

shaosean
01-22-2001, 10:12 AM
Actually it is a "bug" (or feature?) of PHP. Basically it's due to the *nix background where the machine with PHP usually has the sendmail program installed.

When using PHP on Win32 and trying to use the mail() function, the email server _must_ be on the server with PHP, or you will need to construct a SMTP class to talk directly to your ISP's mail server.

I have written such a class, and need to do some major cleaning up of the code and hope to be able to release it shortly.