¿Alguien sabe por qué pasa esto y alguna solución para arreglarlo?
Mi código es el siguiente:
Código:
Un saludo Protected Sub btnEnviar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnEnviar.Click
Dim oMail As New MailMessage
Try
oMail.IsBodyHtml = True
oMail.From = New MailAddress("[email protected]")
oMail.To.Add(New MailAddress("[email protected]"))
oMail.Body = Mensaje()
oMail.Subject = "Noticias"
Dim oSender As New SmtpClient
oSender.Host = System.Configuration.ConfigurationManager.AppSettings("xxxxxx")
oSender.Port = xx
oSender.Send(oMail)
Catch ex As Exception
End Try
End Sub
Private Function Mensaje() As String
Dim oFile As System.IO.File
Dim oRead As System.IO.StreamReader
Dim EntireFile As String
oRead = IO.File.OpenText(Server.MapPath("newsletter.htm"))
EntireFile = oRead.ReadToEnd()
oRead.Close()
oRead = Nothing
oFile = Nothing
Return EntireFile
End Function
End Class


