Jump to content



Photo

IIS7 and SMTP Email issues


  • Please log in to reply
8 replies to this topic

#1 RAINMAN

RAINMAN

    Neowinian

  • Joined: 23-July 02

Posted 06 February 2010 - 17:35

I set up a website on a VPC through my home connection. I got IIS7, PHP and mysql working great.

The issue I am having is getting SMTP working.

I know my ISP is blocking port 25, so in the PHP.ini file I changed the port to 35.

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

; For Win32 only.
sendmail_from = mailer@sbytes.info

I also changed it to port 35 in the IIS manager. Most of the other options there are pretty much default. I turned off the windows firewall and opened port 35 on my router even though I don't think these last 2 should be necessary.

The problem is the mail keeps getting stuck in the Queue folder.

If I open up one of the queued messages it looks as follows:

Received: from SERVER2008 ([127.0.0.1]) by sbytes.info with Microsoft SMTPSVC(7.5.7600.16385);
	 Sat, 6 Feb 2010 12:23:58 -0500
Date: Sat, 06 Feb 2010 12:23:58 -0500
From: mailer@sbytes.info
Subject: test message
To: MyEMAIL@gmail.com
Return-Path: mailer@sbytes.info
Message-ID: <SERVER2008kUfsH1nWM00000005@sbytes.info>
X-OriginalArrivalTime: 06 Feb 2010 17:23:58.0900 (UTC) FILETIME=[2AFE9F40:01CAA751]

test message

Anyone have any ideas what I am doing wrong or things to try? It seems like its getting to the SMTP server but no further then that.


#2 vetAntaris

Antaris

    Neowinian Senior

  • Joined: 25-January 05
  • Location: United Kingdom

Posted 08 February 2010 - 12:30

Have you configured the SMTP settings on IIS7? To send emails, you need to set the server details for IIS7 to relay the message, or store it (which sounds like what it is currently doing):

smtp.png

Obviously putting in the correct details where applicable. If there is a SMTP server running on your local machine, you can use localhost, with the proper port number assigned.

#3 OP RAINMAN

RAINMAN

    Neowinian

  • Joined: 23-July 02

Posted 08 February 2010 - 15:48

Have you configured the SMTP settings on IIS7? To send emails, you need to set the server details for IIS7 to relay the message, or store it (which sounds like what it is currently doing):


Obviously putting in the correct details where applicable. If there is a SMTP server running on your local machine, you can use localhost, with the proper port number assigned.


Where do I see this screen from? This is what I have

Windows Server 2008 x64 Edition-2010-02-08-10-43-28.png
Windows Server 2008 x64 Edition-2010-02-08-10-45-53.png
Windows Server 2008 x64 Edition-2010-02-08-10-48-00.png

#4 vetAntaris

Antaris

    Neowinian Senior

  • Joined: 25-January 05
  • Location: United Kingdom

Posted 08 February 2010 - 16:33

Hmm, Install ASP.NET on that server and see if SMTP-Email pops up?

#5 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 90
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 08 February 2010 - 17:25

Ok a bit confused here.. This is how Im understanding your problem. You have this 2008 server running on a home connection.. And you have web app running on this server -- and you want it to send email

From: mailer@sbytes.info
Subject: test message
To: MyEMAIL@gmail.com

You can change the port all you want on your server -- that does not change what port gmail listens on for mail on You can not just pick a port out of the air and try to send email to that domain on that port. If your wanting to send email from your home server to gmail.com -- and your ISP blocks outbound connections on 25.. Your out of luck - there is nothing you can do on your server to make that work. You would have to forward the traffic through your ISPs smtp servers - if they are blocking outbound connections from their network on 25.

So are you trying to send from your home 2008 box to domains, and your ISP blocks outbound 25.. or are you trying to send to your server and your ISP blocks inbound 25?

Also keep in mind that lots of major domains block email from home/dynamic IPs -- so even if 25 was open you could have issues. Example from comcast IP talking to aol.com mail server.

Connected to mailin-02.mx.aol.com.
Escape character is '^]'.
554- (RTR:DU) http://postmaster.info.aol.com/errors/554rtrdu.html
554 Connecting IP: 24.14.60.xxx
Connection closed by foreign host.

554 RTR:BB

* AOL works with many ISPs to maintain lists of dynamic and residential IP addresses. Per our E-mail Guidelines, we do not accept mail from these addresses. If you are blocked with RTR:BB and have a fully qualified domain name (FQDN), open a support request to lift an RTR:BB block. If you do not have a FQDN, please have your ISP create one for you and then open a support request.

edit: Just so we are clear here -- if you wanting to send to say billy@gmail.com or kim@yahoo.com , etc.. Those servers will all be listening for mail on 25, this is the standard smtp port.. To send mail to any domain - your smtp server does a dns query for the mail servers.

;; QUESTION SECTION:
;gmail.com. IN MX

;; ANSWER SECTION:
gmail.com. 3002 IN MX 30 alt3.gmail-smtp-in.l.google.com.
gmail.com. 3002 IN MX 20 alt2.gmail-smtp-in.l.google.com.
gmail.com. 3002 IN MX 10 alt1.gmail-smtp-in.l.google.com.
gmail.com. 3002 IN MX 40 alt4.gmail-smtp-in.l.google.com.
gmail.com. 3002 IN MX 5 gmail-smtp-in.l.google.com.


;; QUESTION SECTION:
;yahoo.com. IN MX

;; ANSWER SECTION:
yahoo.com. 1499 IN MX 1 g.mx.mail.yahoo.com.
yahoo.com. 1499 IN MX 1 h.mx.mail.yahoo.com.
yahoo.com. 1499 IN MX 1 i.mx.mail.yahoo.com.
yahoo.com. 1499 IN MX 1 mta-v1.mail.re4.am0.yahoodns.net.
yahoo.com. 1499 IN MX 1 a.mx.mail.yahoo.com.
yahoo.com. 1499 IN MX 1 b.mx.mail.yahoo.com.
yahoo.com. 1499 IN MX 1 d.mx.mail.yahoo.com.
yahoo.com. 1499 IN MX 1 e.mx.mail.yahoo.com.
yahoo.com. 1499 IN MX 1 f.mx.mail.yahoo.com.

It then will try to open a connection to these mail servers on port 25.. If your ISP does not allow you to make these connections -- then no your mail server will never be able to send mail to them -- does not matter if you change your smtp servers port or not.

From you computer can you telnet on port 25 to the gmail mail server?

telnet gmail-smtp-in.l.google.com 25
Trying 209.85.216.37...
telnet: Unable to connect to remote host: Connection refused

From a different host that allows for 25 outbound

Trying 209.85.223.44...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP 10si9080892iwn.119

See how it made the connection - IP changes since there are more than 1 ip associated with gmail-smtp-in.l.google.com

Edited by BudMan, 08 February 2010 - 17:37.


#6 OP RAINMAN

RAINMAN

    Neowinian

  • Joined: 23-July 02

Posted 09 February 2010 - 00:52

What you say makes sense. I cannot connect via telnet so what you say is correct.

I guess part 2 of the question would be, I have an ISP SMTP server with authentication. How would I configure this so that I can use it to send mail from my PHP script?

#7 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 90
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 09 February 2010 - 04:00

Well whatever script your using -- does it support using a smtp server with auth? Lots of them do - if not setup your IIS smtp server to use a smarthost, which for sure supports auth to your ISP smtp server.

Where you can run into issues with ISP smtp servers is saying your email came from some other domain, etc.

These are all some of the reasons you don't host websites on home internet connections ;)

Edited by BudMan, 09 February 2010 - 04:02.


#8 OP RAINMAN

RAINMAN

    Neowinian

  • Joined: 23-July 02

Posted 09 February 2010 - 13:01

You guys have been plenty helpful. Thanks for it.

I am using wordpress so whatever email functions there are what I require. I'll look into seeing if it supports smtp server with auth.

This thread can be locked now.

Thanks again.

#9 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 90
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 09 February 2010 - 13:21

There was just a thread about this -- here

http://wordpress.org...s/wp-mail-smtp/