mail() and errors

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
RedRasper
Forum Commoner
Posts: 48
Joined: Thu Apr 24, 2003 6:36 am

mail() and errors

Post 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
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post 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.
RedRasper
Forum Commoner
Posts: 48
Joined: Thu Apr 24, 2003 6:36 am

Post 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
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post 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]
lcidw
Forum Commoner
Posts: 58
Joined: Mon Apr 28, 2003 8:55 am
Location: Netherlands

Post 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..
RedRasper
Forum Commoner
Posts: 48
Joined: Thu Apr 24, 2003 6:36 am

Post by RedRasper »

Thanks!

Got it to work using authentication. Anyone know why the mail() function was stopped from supporting servers that needed authentication?
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post 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.
Post Reply