Código:
Private Sub btnSendSencillo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendSencillo.Click Dim eMail As New MailMessage Dim Attachment As MailAttachment eMail.BodyFormat = "Esto es una prueba" eMail.From = "[email protected]" eMail.To = "[email protected]" eMail.Body = "Mensaje de Prueba" SmtpMail.SmtpServer = "127.0.0.1" Attachment = New MailAttachment("Prueba.xml") 'Cuando comento la linea de abajo todo funciona bien eMail.Attachments.Add(Attachment) Try SmtpMail.Send(eMail) Catch MessageBox.Show("No se puede enviar el mensaje, pruebe que el servidor SMTP este habilitado" ) End Try End Sub