outlook

  • hi, hab mir mal hier nene microsoft outlook nachrichten schreiber gemacht.

    [autoit]

    $email = InputBox("EmailAdresse", "An wen soll die E-mail geschickt werden?", "name@provider.at", "", _
    400, 100, 50, 50)
    $betreff = InputBox("Betreff", "Geben sie den E-mail Betreff ein", "Betreff", "", _
    400, 100, 50, 50)
    $text = InputBox("Text", "Text eingeben", "Text", "", _
    400, 100, 50, 50)
    $anzahl = InputBox("Anzahl", "Anzahl der E-mails", "0", "", _
    400, 100, 50, 50)

    [/autoit][autoit][/autoit][autoit]

    $anzahl = $anzahl - 1
    Func outlook($email, $betreff, $text)
    Opt ("WinTitleMatchMode", 2)
    Opt ("SendKeyDelay", 0)
    WinActivate ("Posteingang - Microsoft Outlook")
    MouseClick ("left", 39, 49, 1, 0)
    WinWait ("Unbenannte Nachricht")
    WinActivate ("Unbenannte Nachricht")
    Send ($email)
    ControlClick("Unbenannte Nachricht", "", 4102, "left", 1)
    Send ($betreff)
    Send ("{ENTER}")
    Send ($text)
    MouseClick ("left", 44, 60, 1, 0)
    EndFunc
    For $i = 0 to $anzahl Step 1
    outlook($email, $betreff, $text)
    Sleep(1000)
    Next

    [/autoit]

    nun ein paar fragen:

    was hält ihr davon?
    kann man es verbessern?

    #include <GUIConstants.au3> <-- in der datei stehen weiter includes, muss ich die ganzen anderen datein auch in den selben ordner kopieren, wie mein au3 script welche auch mit GUI anwendungen läuft? :lol:

    Einmal editiert, zuletzt von hxhjx (14. Januar 2007 um 15:50)

    • Offizieller Beitrag

    Hallo und nochmal ein herzliches :willkommen:

    Sieht gut aus!! :) Nur leider gibt es sowas änliches schon :( Die funktion heißt _INetMail!

    Hier mal ein Example code:

    [autoit]

    #include <INet.au3>

    [/autoit][autoit][/autoit][autoit]

    $Address = InputBox('Address', 'Enter the E-Mail address to send message to')
    $Subject = InputBox('Subject', 'Enter a subject for the E-Mail')
    $Body = InputBox('Body', 'Enter the body (message) of the E-Mail')
    MsgBox(0,'E-Mail has been opened','The E-Mail has been opened and process identifier for the E-Mail client is ' & _INetMail($address, $subject, $body))

    [/autoit]

    Beim include: Nein musst du nicht! Die includes müssen halt nur im autoit include ordner sein, da wo sie normaler weise ja auch sind! Wenn du den Soruce code Compelierst (zur selbständigen exe machst) dann brauchst du grakeine dateien mehr da sie in der exe included (Eingebettet) werden!

    Mfg Spider

    Edit: Achso.. und warum hast du es ins Hilfe forum gestellt? Ich pack es mal in Scripte rein!
    Aktion GtaSpider: Beitrag "outlook" in "Hilfe & Unterstützung" --> "Scripte"

  • ich möchte nicht sagen, dass das script als spamprogramm auch zu verwenden ist.. :stolz_bin: aber man kann die anzahl der email eingeben.

    also wenn du keine verbesserungvorschläge hast, hätte ich da noch ne frage. und zwar auf dem laptop meines freundes funktioniert das skript (exe) gar nicht.

    2. die run(outlook.exe...) funktion funktioniert nicht. könntest du mir da vielleicht ein bsp geben?

    3. du sagtest es gibt so etwas schon?? auch für outlook? :weinen:

    • Offizieller Beitrag

    Hier die Funktion für SMTP-Mail von Jos:

    Spoiler anzeigen
    [autoit]

    Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", _
    $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "",$IPPort=25, $ssl=0)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
    $objEmail.HTMLBody = $as_Body
    Else
    $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
    Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
    For $x = 1 To $S_Files2Attach[0]
    $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
    If FileExists($S_Files2Attach[$x]) Then
    $objEmail.AddAttachment ($S_Files2Attach[$x])
    Else
    $i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
    SetError(1)
    return 0
    EndIf
    Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
    ;Authenticated SMTP
    If $s_Username <> "" Then
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    If $Ssl Then
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    EndIf
    ;Update settings
    $objEmail.Configuration.Fields.Update
    ; Sent the Message
    $objEmail.Send
    if @error then
    SetError(2)
    return $oMyRet[1]
    EndIf
    EndFunc ;==>_INetSmtpMailCom

    [/autoit]


    Arbeitet mit den meisten SMTP-Mail Accounts. Also unabhängig von Outlook.