Outlook öffnen

  • VB.NET

    Outlook öffnen

    Liebe COmmunity

    Ich stehe gerade wieder auf dem Schlauch.

    Ich habe eine Funktion gemacht mit welcher ich eine E-Mail senden kann.
    Nun möchte ich auf den Button_klick nicht die Email gleich senden sondern , dass das Outlook aufgeht mit den zuvor eingegebenen Paramtern (sendTo,Subject,Message).
    Damit der sender seine E-Mail noch einmal überprüfen kann.

    VB.NET-Quellcode

    1. Public Sub send(ByVal senTo As String)
    2. Try
    3. ' Create an Outlook application.
    4. Dim oApp As Outlook._Application
    5. oApp = New Outlook.Application()
    6. ' Create a new MailItem.
    7. Dim oMsg As Outlook._MailItem
    8. oMsg = CType(oApp.CreateItem(Outlook.OlItemType.olMailItem), Outlook._MailItem)
    9. oMsg.Subject = "Send Attachment Using OOM in Visual Basic .NET"
    10. oMsg.Body = "Hello World" & vbCr & vbCr
    11. oMsg.To = senTo
    12. Dim sBodyLen As String = CStr(oMsg.Body.Length)
    13. Dim oAttachs As Outlook.Attachments = oMsg.Attachments
    14. Dim oAttach As Outlook.Attachment
    15. ' Send
    16. oMsg.Send()
    17. MessageBox.Show("E-Mail wurde gesendet")
    18. ' Clean up
    19. oApp = Nothing
    20. oMsg = Nothing
    21. oAttach = Nothing
    22. oAttachs = Nothing
    23. Catch ex As Exception
    24. End Try
    25. End Sub


    EIDT::

    LÖSUNG:

    VB.NET-Quellcode

    1. oMsg.Display(True)

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Lingo“ ()