Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/11/2012, 12:04
3ricks0ul
 
Fecha de Ingreso: junio-2012
Mensajes: 90
Antigüedad: 11 años, 10 meses
Puntos: 2
Respuesta: Enviar mensajes con adjuntos desde C#

Puedes utilizar como referencia el equivalente en VB

Código vb:
Ver original
  1. Imports System.Net.Mail
  2. *
  3. Dim smtp As New System.Net.Mail.SmtpClient
  4. * * * * * * Dim correo As New System.Net.Mail.MailMessage
  5. [B]* * * * * * Dim Att As System.Net.Mail.Attachment[/B]
  6. *
  7. * * * * * * With smtp
  8. * * * * * * * * .Port = "Puerto"
  9. * * * * * * * * .Host = "smtp.server"
  10. * * * * * * * * .Credentials = New System.Net.NetworkCredential("tu correo", "tu password")
  11. * * * * * * * * .EnableSsl = False
  12. * * * * * * End With
  13. *
  14. * * * * * * With correo
  15. * * * * * * * * .From = New System.Net.Mail.MailAddress("tucorreo")
  16. * * * * * * * * .To.Add(Label1.Text) ' Aqui va el destinatario o puedes leerlo de un lbl
  17. * * * * * * * * .Subject = "Titulo mail"
  18. * * * * * * * * .Body = "<strong><b>Aqui va el mensaje, de igual manera puedes leerlo de un textbox o un label</b></strong>"
  19. * * * * * * * * .IsBodyHtml = True
  20. * * * * * * * * .Priority = System.Net.Mail.MailPriority.Normal ' Le das la prioridad
  21. * * * * * * End With
  22. * * * * * * smtp.Send(correo)