Page 1 of 1

mail() and errors

Posted: Mon Apr 28, 2003 8:46 am
by RedRasper
Hello,

I've just been trying to get mail to work. and I keep getting :

PHP Warning: mail() [<a href='http://www.php.net/function.mail'>function.mail</a>]: SMTP server response: 550 relaying to <chris@bchdigital.com> prohibited by administrator in c:\apache\apache2\htdocs\feedback.php on line 14, referer: http://localhost/TMP377dze2295.html


As an error. I'm using : mail($to,$re,$msg); to send the message.

my settings in php.ini are:

[mail function]
; For Win32 only.
SMTP = roam.mail.uk.vianw.net

; For Win32 only.
sendmail_from = chris@bchdigital.com

Its a windows platform running apache and php 4.3.1.

If anyone has any idea I would be greatful. I've looked through the previous posts in the forum, and in the manual and can't seen to find an answer.

Cheers

RedRasper

Posted: Mon Apr 28, 2003 8:50 am
by []InTeR[]
The error is, that you may not send e-mail trou the mailserver 'roam.mail.uk.vianw.net' to chris@bchdigital.com.

So, you must find a other outgoing mail server.

Posted: Mon Apr 28, 2003 8:56 am
by RedRasper
Was just talking to someone about that, they had a similar problem with VB. Basically you need to log into the smtp server.

Does PHP support something like that?

Cheers

Posted: Mon Apr 28, 2003 8:58 am
by []InTeR[]
I don't know if php's supporting it directly but there is a smtp class.
http://www.phpguru.org/smtp.html

[edit: beter link]

Posted: Mon Apr 28, 2003 9:07 am
by lcidw
Make sure that you allow your own server to relay (IP 127.0.0.1). Don't just block all relaying.

You should also look here for SMTP servers which require authentication..

Posted: Mon Apr 28, 2003 9:51 am
by RedRasper
Thanks!

Got it to work using authentication. Anyone know why the mail() function was stopped from supporting servers that needed authentication?

Posted: Mon Apr 28, 2003 11:57 am
by m3mn0n
I'm not sure of the exact reason, but i figured if you can't send an email through Outlook or something on the fly without authentication, you can't send mail through php/apache.

As long as you have the right settings in php.ini and auto authentication working in Outlook or any other mail client, it should work.