Problem sending email to address of different domain

M

moondaddy

I have some code in a web app (asp.net 2.0) and am trying to send an email
to 2 different recipients. The first one works and the second one fails.
the first email address is of the same domain as the web app (myAp.com,
(e-mail address removed)) and the second one is of a different domain
([email protected]). Why would the 2nd address fail? here's the error msg

Mailbox unavailable. The server response was: not local host
OtherDomain.com, not a gateway at
System.Net.Mail.SmtpTransport.SendMail(MailAddress sender,
MailAddressCollection recipients, String deliveryNotify,
SmtpFailedRecipientException& exception)

and here's the code:

For Each sAddress In adrses
Dim msg As System.Net.Mail.MailMessage = New
System.Net.Mail.MailMessage()
msg.To.Add(sAddress)
msg.Subject = Caption
msg.Body = "New Data Element Has Been Submitted." & vbNewLine &
vbNewLine & data
msg.From = New System.Net.Mail.MailAddress("(e-mail address removed)")
mailSvr.Send(msg)
Next sAddress


How can I send email to other address such as customers?

Thanks.
 
W

Walter Wang [MSFT]

I agree with Ciaran that you need to config relay restrictions in IIS
manager:

1) open "Default SMTP Virtual Server" properties dialog
2) in "Access" tab, click "Relay" button


Sincerely,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Walter Wang [MSFT]

Thanks for the follow-up. Please feel free to reply here if there's
anything I can help.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,696
Latest member
BarbraOLog

Latest Threads

Top