La clase es sencilla, es para enviar correos con autentificación:
Código:
Con un proyecto normal de biblioteca de clases no puedo usar System.Web.Mail.MailMessage#Region "Mensajes por SMTP"
Public Class Mensaje
Protected Friend Desde As String = ConfigurationSettings.AppSettings("mailCartero")
Protected Friend Hacia As String = ""
Protected Friend Titulo As String = ""
Protected Friend Cuerpo As String = ""
Protected Friend Adjunto As String = ""
Public Sub enviar()
Dim mensaje As New System.Web.Mail.MailMessage
With mensaje
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
.From = Desde
.To = Hacia
.Subject = Titulo
.Body = Cuerpo
.BodyFormat = Mail.MailFormat.Html
If Adjunto <> "" Then
.Attachments.Add(Adjunto)
End If
End With
Dim mailSMTP As System.Web.Mail.SmtpMail
mailSMTP.SmtpServer = ConfigurationSettings.AppSettings("SMTPServer")
mailSMTP.Send(mensaje)
End Sub
End Class
#End Region
¿sigo haciéndolo como proyecto web o hay otra manera?
Gracias y un saludo.

