I am running Windows server 2008 R2 Enterprise with IIS 7.5 & 6.0 and the SMTP service enabled. Following this guide, the SMTP service was installed and configured to relay outbound emails via my personal gmail account:

IIS 6.0 (SMTP Virtual server #1)

  • outbound security: basic authentication (myemail@gmail.com + password) + TLS encryption
  • outbound connections: TCP port=587
  • advanced: Smart host = smtp.gmail.com

IIS 7.5 (SMTP E-mail)

  • E-mail address: no-reply@mydomain.com
  • SMTP Server: smtp.gmail.com
  • Port: 587
  • Specify credentials: myemail@gmail.com + password

When I make a test with telnet:

220 SERVER Microsoft ESMTP MAIL Service, Version: 7.5.7601.17514 ready
250-SERVER Hello []
250-SIZE 2097152
250 OK
mail from:no-reply@mydomain.com
250 2.1.0 no-reply@mydomain.com....Sender OK
rcpt to:myemail@gmail.com
250 2.1.5 myemail@gmail.com
354 Start mail input; end with <CRLF>.<CRLF>
Subject:Test subject

This is the email body

250 2.6.0 <SERVER> Queued mail for delivery

It does work but here is what I get in Gmail:

Return-Path: <myemail@gmail.com>
Received: from SERVER
        by mx.google.com with ESMTPS id g9sm9663174wix.1.2013.
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Wed, 17 Apr 2013 06:20:49 -0700 (PDT)
Received: from  ([]) by SERVER with Microsoft SMTPSVC(7.5.7601.17514);
     Wed, 17 Apr 2013 15:03:07 +0200
Subject: Subject:Test subject
From: myemail@gmail.com
Return-Path: no-reply@mydomain.com
Message-ID: <0000000a@SERVER>
X-OriginalArrivalTime: 17 Apr 2013 13:03:16.0990
Date: Wed, 17 Apr 2013 06:20:49 -0700 (PDT)

This is the email body

enter image description here

As you can see there are a several issues:

  • the destination email (myemail@gmail.com) has become the source and the 1st return path
  • there is no destination email anymore
  • what I had setup as a source (no-reply@mydomain.com) is only present in the 2nd return path

Q1: Is someone able to explain why that is?

Also, I read on Google forums that there is a 500 emails / day limit which means that even I manage to fix the above problems it still won't be good enough as I need to send more emails than that.

Q2: Is there a way (with or without IIS SMTP) to get the server to send emails directly to whatever the destination email address without going through a relay ?

3 Answers 3


Q2: Is there a way (with or without IIS SMTP) to get the server to send emails directly to whatever the destination email address without going through a relay ?

A: Yes. Create a remote domain for each gTLD you want to send email to and remove the forwarding configuration. SMTP will then use DNS to locate the email servers for those remote domains and will deliver email directly to those remote domains.

For instance, if you want to send email to any .com email address then create a remote domain for *.com. Do likewise for any other gTLD that you want to send email to.

  • Thanks a lot. Everything is working except one thing: the destination email address is still empty, despite setting it properly with RCPT TO:: any idea?
    – Max
    Apr 17, 2013 at 14:03
354 Start mail input; end with <CRLF>.<CRLF>
Subject:Test subject

should be

354 Start mail input; end with <CRLF>.<CRLF>
From: no-reply@mydomain.com
To: myemail@gmail.com
Subject:Test subject

If you don't add the From: text gmail will add From: myemail@gmail.com To: should also be added to follow the standard way of SMTP.


This is really OS agnostic.

Q1: that is what google does - it rewrites everything as if coming from @gmail.com. Things may be different if you go google apps (and route all email through google), but I haven't really researched that.

Q2: Get an IP address with good forward and reverse DNS resolution (meaning => your.mail.server; your.mail.server => and take care of its reputation. Dynamic IP addresses, static unresolved IPs, names like dyn-44-33-22-11.spamking.ru, half baked dynamic dns schemes are going to give you headaches and you'll spend all of your free time getting out of BLs. Easiest thing would be relaying through your upstream provider smarthost (in this country, the service usually comes free with subscription). If your bent is mass mailing (as I gather from your need to send upwards of 500 emails/day) then you're in payola country either way (as the IP addresses I described aren't going to be free, and your upstream will quickly take umbrage).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.