Problem sending email to address of different domain

Discussion in 'ASP .Net' started by moondaddy, Dec 6, 2006.

  1. moondaddy

    moondaddy Guest

    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,
    ) and the second one is of a different domain
    (). 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("")
    mailSvr.Send(msg)
    Next sAddress


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

    Thanks.



    --
    ail
     
    moondaddy, Dec 6, 2006
    #1
    1. Advertising

  2. 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 (, 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.
     
    Walter Wang [MSFT], Dec 6, 2006
    #2
    1. Advertising

  3. moondaddy

    moondaddy Guest

    Thanks Walter, now I know what I need to do.


    "Walter Wang [MSFT]" <> wrote in message
    news:h0f$...
    >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 (, 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.
    >
     
    moondaddy, Dec 8, 2006
    #3
  4. Thanks for the follow-up. Please feel free to reply here if there's
    anything I can help.

    Regards,
    Walter Wang (, 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.
     
    Walter Wang [MSFT], Dec 11, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGF1cmF2aQ==?=

    Problem with Sending Email outside of Domain

    =?Utf-8?B?UGF1cmF2aQ==?=, Feb 12, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    3,409
    Chad Z. Hower aka Kudzu
    Feb 18, 2004
  2. Jim in Arizona
    Replies:
    8
    Views:
    4,985
    Jim in Arizona
    Jan 24, 2006
  3. Replies:
    2
    Views:
    579
    Christopher Reed
    Apr 15, 2006
  4. Luke
    Replies:
    2
    Views:
    4,762
    Nigel Wade
    Mar 15, 2007
  5. Cindy Lee
    Replies:
    2
    Views:
    154
Loading...

Share This Page