lunes, 2 de marzo de 2020

Enviar email desde vb.net (SENCILLO)

Private Sub EnviarMail(ByVal EMails As String, ByVal TextoAsunto As String, ByVal TextoCuerpo As String)

        myOlApp = New Microsoft.Office.Interop.Outlook.Application
        Dim myOlItem As Microsoft.Office.Interop.Outlook.MailItem

        Try
            myOlItem = myOlApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
            With myOlItem
                .To = EMails
                .Subject = TextoAsunto
                .Body = TextoCuerpo
                .Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh
            End With
            myOlItem.Send()

        Catch ex As System.Exception
        End Try

    End Sub

No hay comentarios:

Publicar un comentario

Los mail de oulook no se pueden reenviar.

 cuando en el asunto poseen un caracter especial por ejemplo @#$ los correos no salen y no te muestra ningun correo de rebote, especialmente...