sending email from iis to exchange doesn't work
Hi,
I have an IIS 6 server running 4 websites. I have 1 website setup to send an email to me when a user signs up for a newsletter. I am trying to setup a second website to email its owner when a users wants their newsletter. I get my email,
the other guy doesn't. If I change his email address to mine I get the email so the problem is with exchange and not iis.
website 1: xabc.com my email: user@xabc.com
website 2: xyz.us his email: user@xyz.us
In short with code below I get email when the emailto is set to me. The other user doesn't get email when the code is set to his email. The exchange 2003 SP2 server is setup to receive email from both domains. I followed the directions
at:
http://www.petri.co.il/configure_exchange_2000_2003_to_receive_email_for_other_domains.htm
and the user can send and receive email from everyone else. For some reason Exchange isn't delivering the message. I used the message tracking center and I see the email gets to Exchange and it says SMTP: Message Routed and Queued for Remote
Delivery but the email never comes. The receiving address is a distribution group if it matters. If a person emails that address everyone gets that email. If IIS sends an email to that address it gets lost.
What did I do wrong?
The IIS code if you want it is:
<%
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim comments
Dim Name
' get posted data into variables
EmailFrom = "website1"
EmailTo = "user@xabc.com"
Subject = "newsletter signup"
comments = Trim(Request.Form("comments"))
Name = Trim(Request.Form("Name"))
' prepare email body text
Dim Body
Body = Body & "From: " & Name & VbCrLf
Body = Body & "Comments: " & comments & VbCrLf
' send email
Dim mail
Set mail = Server.CreateObject("CDO.Message")
With mail.Fields
' For Outlook 2003
.Item("urn:schemas:mailheader:X-MSMail-Priority") = 2
.Item("urn:schemas:httpmail:importance") = 2
' For Outlook Express
.Item("urn:schemas:mailheader:X-Priority") = 1
.Update
End With
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.TextBody = Body
mail.Send
if err <> 0 then
Response.Write "Email has NOT been sent"
else
Response.Write "Email has been sent"
end if
%>
August 25th, 2010 5:54pm
If the last entry is referring to routing but nothing else then the message is being blocked or dropped before delivery. Exchange is accepting the email, then dropping it for some reason. This could be AV, Antispam, a restriction on the group, something
like that.
Simon.Simon Butler, Exchange MVP. http://blog.sembee.co.uk , http://exbpa.com/
Free Windows Admin Tool Kit Click here and download it now
August 25th, 2010 6:49pm
The problem was DNS related. The email server didn't have a DNS Zone for xyz.us.
August 25th, 2010 7:35pm