Ergebnis 1 bis 15 von 310

Thema: Tutorial e-Mail und SMS Alarm

Baum-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #11
    Registriert seit
    27.07.2007
    Beiträge
    225
    Ich habe da eine vbs lösung gefunden welche alle möglichen dateien aus einem bestimmten ordner mit versenden kann.
    diese vbs datei läuft ohne Blat.exe, Clemail.exe usw..

    HIER DER CODE DER DATEI
    --------------------------------------------------------------



    Set ws = CreateObject("WScript.Shell")

    Dim FS, DS, File, Pfad, Anhang, ENachricht, NachRicht
    Const cdoSendUsingPickup = 1
    Const cdoSendUsingPort = 2

    Const cdoAnonymous = 0
    Const cdoBasic = 1
    Const cdoNTLM = 2

    ' SEND MAIL
    Pfad = "D:\emailalarm\test\"

    if Pfad = "" then
    AuS
    else
    'nix
    end if

    Set objMessage = CreateObject("CDO.Message")

    objMessage.Subject = "AlarmFax"
    objMessage.From = """AlarmFax"" Ausgang eMail>"
    objMessage.To = "Eingang eMail"
    objMessage.TextBody = "AlarmFax"

    'Dateien
    Set FS = CreateObject("Scripting.FileSystemObject")
    If FS.FolderExists (Pfad)=True Then
    'msgbox "Ordner ist da!",vbinformation,"Ordner da!"
    Set DS = FS.GetFolder(Pfad)
    for Each File in DS.Files
    Anhang = File.Name
    objMessage.AddAttachment Pfad & Anhang
    next
    Set DS = Nothing
    Set FS = Nothing
    else
    msgbox "Ordner ist nicht da!",vbinformation,"Ordner nicht da!"
    set FS = nothing
    end if

    'Konfiguration SMTP Server

    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.gmx.net"

    'Type of authentication, NONE, Basic (Base64 encoded), NTLM
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

    'Your UserID on the SMTP server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "Ausgang eMail"

    'Your password on the SMTP server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSWORT"

    'Server port (typically 25)
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

    'Use SSL for the connection (False or True)
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

    'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

    objMessage.Configuration.Fields.Update

    objMessage.Send

    Set objMessage = Nothing

    AuS

    Private Sub AuS
    WScript.Quit
    End Sub
    Geändert von DonnerGott (25.06.2009 um 21:23 Uhr)

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •