Kennt jemand eine Möglichkeit mit VBScript eine eMail zu senden ?

  • VBScript

Es gibt 3 Antworten in diesem Thema. Der letzte Beitrag () ist von chris_its.

    Hello,

    hab hier ein Script, mit dem du auch einen Mail erstellen kannst wenn Outlook nicht geöffnet ist.

    Funktioniert super.

    CU



    Visual Basic-Quellcode

    1. Dim oApp, oMail, bOLStarted
    2. On Error Resume Next
    3. Set oApp = GetObject("","Outlook.Application")
    4. If oApp Is Nothing Then
    5. Set oApp = CreateObject("Outlook.Application")
    6. bOLStarted = Not oApp Is Nothing
    7. End If
    8. Err.Clear
    9. If Not oApp Is Nothing Then
    10. On Error Resume Next
    11. Set oMail = oApp.CreateItem(0)
    12. Err.Clear
    13. If Not oMail Is Nothing Then
    14. oMail.To = "test@test.com"
    15. oMail.Subject = "TestSubject"
    16. oMail.Body = "TestBody"
    17. 'oMail.Sensitivity = 2 'Vertraulichkeit: Privat
    18. 'oMail.Importance = 2
    19. 'oMail.VotingOptions = "- Option1 -"
    20. ' oMail.... = ...
    21. oMail.Display
    22. Set oMail = Nothing
    23. Else
    24. MsgBox "Fehler beim Erstellen der Mail"
    25. End If
    26. If bOLStarted Then oApp.Quit
    27. Set oApp = Nothing
    28. Else
    29. Msgbox "Fehler beim Ermitteln/Erstellen einer Outlook Instanz"
    30. End If