Help I can sent emails from the website

Discussion in 'ASP.NET 2.0' started by andyhudson, Nov 18, 2009.

  1. This worked last night but now whatever I try, I can not receive any emails from the website. Do I need to be doing anything else in the web config file for example?

    Dim s_Subject As String = "Test"
    Dim s_Send_From As String = "[email protected]"
    Dim s_Send_To As String = "[email protected]"
    Dim s_Email_Body As String = "This is a test"


    Dim objSMTP As New SmtpClient
    Dim Message As New MailMessage

    objSMTP.Host = "localhost"

    Message.From = New MailAddress(s_Send_From)
    Message.To.Add(s_Send_To)
    Message.Subject = s_Subject
    Message.IsBodyHtml = False
    Message.Body = s_Email_Body

    objSMTP.Send(Message)
     
  2. Your script looks good to me. Did you try looking in a spam folder?
     

Share This Page