Link to home
Create AccountLog in
Avatar of nacker2000
nacker2000

asked on

Send email problem with Windows Server 2003 IIS6

Hi,

I have a site hosted on a Windows Server 2003 using IIS6. My SMTP server is setup to not to allow relaying so that no spammers can use my server.

The problem is that I can't send emails to any address outside of my domain, so aperson@hotmail for example will fail to send but aperson@mydomain.com will send. I've tried both the PHP mail() method and PHPMailer class but both fail!?

Obviously if I allow relaying then it works fine, but I'm open to spammers using my server.

How do I configure my SMTP server in IIS6 to allow php to send out emails to any domain but at the same time keep my server safe from spammers?
Avatar of hernst42
hernst42
Flag of Germany image

Typical you only allow authed users to send mails to other domains than yours. Then use such a authed user in the phpmailer class to deliver the mails to your SMTP-server.
Maybe this helps: http://support.microsoft.com/kb/310356
All smtp requests from your website use the same account/host (IUSR_COMPUTERNAME / 127.0.0.1). Allow relaying for localhost on ip 127.0.0.1.

To protect yourself from spammers, employ antispam filters in your mailing scripts. In order for the messages that are generated to get to their destination, the webserver's external IP address must be static, with a reverse DNS.

Google will show you plenty of anti-spam php scripts along with CATCHA functionality to help stop the bots.

Here's a dead simple example that prevents spam by disabling header modification:

https://www.experts-exchange.com/questions/22510612/Need-a-good-sendmail-php-form.html?anchorAnswerId=18909599#a18909599
Avatar of nacker2000
nacker2000

ASKER

Thanks for the link hernst42, but I still can't get it to work. If I try to use authentication in the mailer class It just fails to authorize the user.

I have a feeling that even if I get the user authorized that it still wouldn't allow me to send to other domains other than my own.

I can block external SMTP relay request by configuring my firewall, which works fine because I can turn on relaying with no risk from spammers. I tried this and it works fine.

v2Media thanks for the posts but it is my SMTP server that is at risk to spammers not my scripts.
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I'm no expert either, hence my problems... lol!?
I have managed to reslove this now. It was a mix of configuration issues and Windows errors.