Visual Basic.NET - Configurar correo

 
Vista:

Configurar correo

Publicado por Jorge (20 intervenciones) el 14/07/2005 20:36:17
Hola alguien podria decirme como configurar un proyecto para enviar un mail,tengo el WXP con el IIS instalado,mi codigo es:

*************************************
Dim oMsg As MailMessage = New MailMessage

' TODO: Replace with sender e-mail address.
oMsg.From = "[email protected]"
' TODO: Replace with recipient e-mail address.
oMsg.To = "[email protected]"
oMsg.Subject = "Send using Web Mail"

' SEND IN HTML FORMAT (comment this line to send plain text).
oMsg.BodyFormat = MailFormat.Html

'HTML Body (remove HTML tags for plain text).
oMsg.Body = "<HTML><BODY><B>Hello World!</B></BODY></HTML>"

' ADD AN ATTACHMENT.
' TODO: Replace with path to attachment.
Dim sFile As String = "C:\caca1.lis"
Dim oAttch As MailAttachment = New MailAttachment(sFile, MailEncoding.Base64)

oMsg.Attachments.Add(oAttch)

' TODO: Replace with the name of your remote SMTP server.
SmtpMail.SmtpServer = "MySMTPServer"
SmtpMail.Send(oMsg)

oMsg = Nothing
oAttch = Nothing
********************************************************
me sale el error :
Información adicional: No se puede obtener acceso al objeto 'CDO.Message'.
QUE HAGO MAL?
Es por no configurar el SmtpMail.SmtpServer.Si es eso alguien puede decirme ocmo configurarlo.
MUchas Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder