Can't send emails to hotmail and yahoo

Discussion in 'ASP.NET 2.0' started by Xantango, Sep 16, 2008.

  1. I'm testing my new web site from my local computer, i can send emails to my DASP domain emails account. However, i couldn't do the same thing with hotmail and yahoos.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

  3. smtp.[MyDomainName].com, which hosted by DASP.NET
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    let me make sure i understand. You are running an application from your home computer and the app is configured to use our mail server as the relay server.


    If that's the case, did you configure SMTP authentication in your application?


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. Yes, i have tried that. Plus, when i send an email to [email protected] it went out smoothly.


    The problem occurs when i send emails to Yahoo, Hotmail, etc
     
  6. Bruce

    Bruce DiscountASP.NET Staff

    Can you post the code as well as the name of the SMTP server?

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  7. the error states:


    "Mailbox unavailable. The server response was: [email protected] No such user here."
     
  8. Bruce

    Bruce DiscountASP.NET Staff

  9. Imports System


    Imports System.Net.Mail


    Imports System.Web.UI


    Imports System.Web.UI.WebControls


    Imports System.Web.UI.HtmlControls


    Imports Microsoft.VisualBasic


    Public Class Utilities


    Public Shared Sub SendMail(ByVal From As String, ByVal ToEmail As String, ByVal Subject As String, ByVal Body As String)


    Try


    Dim MailClient As New SmtpClient(XanMartConfiguration.MailServer) ' My SMTP SERVER IS "smtp.MyDomainName.com"


    Dim MyMailMessage As New MailMessage(New MailAddress(From.Trim).ToString, New MailAddress(ToEmail.Trim).ToString, Subject, Body)


    MailClient.Send(MyMailMessage)


    Catch ex As Exception


    MsgBox(ex.Message.ToString) ' To Test


    End Try


    End Sub
    EndClass


    My SMTP isstored in the web.config file

    Thank you for your patience.


    Post Edited (Xantango) : 9/20/2008 7:25:57 PM GMT
     
  10. Dear wisemx
    I've tried your code, unfortunately, it gaves me the same error message as i state earlier!
     
  11. Here is the error message:


    "Mailbox unavailable. The server response was: <[email protected]> No such user here."


    And my web.config section:


    <system.net>


    <mailSettings>


    <smtp from="">


    <network host="smtp.MYDOMAINNAME.com" port="25" />


    </smtp>


    </mailSettings>


    </system.net>


    The reason i did not use "localhost", cuz, i'm testing my web site from home computer.


    Thank you in advance.
     
  12. So what might be wrong?


    what might be relevant?
     
  13. Hi,
    There are many things that can go wrong.
    What errors are you getting now?
    By the way, what does your SMTP section of your root web.config look like?

    Should look like this:

     
  14. Thank you
     

Share This Page