Empfänger auswählen und Standard-E-Mail verschicken?

  • Hallo Schnitzel jetzt passt es :thumbup:

    zwei Fragen noch:
    1. Wenn der Abstand zwischen angezeigten e-Mail Adresssen kleiner werden soll (*20), wo muss ich dies alles anpassen damit bei neuhinzufügten e-Mails sich die Fenstergröße weiterhin automatisch anpasst?

    2. Lassen sich die Namen (die aus Email.ini gelesen werden) in GUI automatisch alphabetisch anzeigen?

    Besten Dank!

    Viele Grüße,
    Dino

  • *g* bald haben wir echt nen email client zusammen :D

    1. die x position der checkboxen is das hier: 5 + (Round($i/2) - 1)*30
    wenn du *30 änderst in *29 is das ganze enger zusammmen ;)
    das musst du dann aber auch bei allen controls darunter ändern

    2. das geht natürlich auch. _ArraySort sollte da die passende lösung sein ;)

  • Zitat

    *g* bald haben wir echt nen email client zusammen

    :rofl::rofl:

    1. Ich habe die Abstandsgröße geändert, aber oberhalb des $label1 sind jetzt mindestens 5cm freien Platz. Ich habe 5 + (Round($i/2) - 1)*30 in 5 + (Round($i/2) - 1)*20 ersetzt. Richtig?

    2. wo genau muss ich _ArraySort einfügen?

    3. Ich habe noch ein Button3 eingefügt, und damit die Email.ini zu öffnen. Fehlt mir der Aufruf der Email.ini Datei.

    Noch diese drei Punkte und dann sind wir fertig mit ESC (E-Mail-Schnitzel-Client) ;):D

    Aktuelle Datei:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <Inet.au3>
    Global $section, $combodata
    $section = IniReadSection("Email.ini", "Emails")
    Dim $Checkbox[$Section[0][0]+1]

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

    $Form1 = GUICreate("Email Prog", 400, Round($section[0][0]/2)*30+290)
    For $i = 1 To $Section[0][0]
    $Checkbox[$i] = GUICtrlCreateCheckbox($Section[$i][0], 205 - Mod($i, 2)*200, 5 + (Round($i/2) - 1)*20, 190, 25)
    Next
    $label1 = GUICtrlCreateLabel("_________________________________________________________________", 5, (Mod($section[0][0], 2) +Round($i/2) - 1)*30 - 5, 390, 25)
    $label2 = GUICtrlCreateLabel("Betreff:", 5, 18 + (Mod($section[0][0], 2) +Round($i/2) - 1)*30, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Input1 = GUICtrlCreateInput(IniRead("Email.ini", "Standards", "Betreff", ""), 5, 35 + (Mod($section[0][0], 2) +Round($i/2) - 1)*30, 390, 25)
    GUICtrlSetBkColor(-1, 0xFFFFE1)
    $label2 = GUICtrlCreateLabel("Nachrichttext:", 5, 78 + (Mod($section[0][0], 2) +Round($i/2) - 1)*30, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Edit1 = GUICtrlCreateEdit(StringReplace(IniRead("Email.ini", "Standards", "Nachricht", ""), " |@CRLF| ", @CRLF) , 5, 95 + (Mod($section[0][0], 2) +Round($i/2) - 1)*30, 390, 100)
    GUICtrlSetBkColor(-1, 0xFFFFE1)
    $label3 = GUICtrlCreateLabel("Empfänger:", 5, 213 + (Mod($section[0][0], 2) +Round($i/2) - 1)*30, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Input2 = GUICtrlCreateInput("", 5, 230 + (Mod($section[0][0], 2) +Round($i/2) - 1)*30, 390, 25)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $Button1 = GUICtrlCreateButton("Standards speichern", 5, 260 + (Mod($section[0][0], 2) +Round($i/2) - 1)*30, 150, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button3 = GUICtrlCreateButton("e-Mail.ini", 170, 260 + (Mod($section[0][0], 2) +Round($i/2) - 1)*30, 90, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button2 = GUICtrlCreateButton("Email senden", 275, 260 + (Mod($section[0][0], 2) +Round($i/2) - 1)*30, 120, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetBkColor(-1, 0xC0DCC0)
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Checkbox[1] To $Checkbox[$Section[0][0]]
    $emails = ""
    For $i = 1 To $Section[0][0]
    If BitAnd(GUICtrlRead($Checkbox[$i]), $GUI_CHECKED) Then
    $emails &= $Section[$i][1] & "; "
    EndIf
    Next
    Guictrlsetdata($Input2, $emails)
    Case $Button1
    IniWrite("Email.ini", "Standards", "Betreff", GUICtrlRead($Input1))
    IniWrite("Email.ini", "Standards", "Nachricht", StringReplace(GUICtrlRead($Edit1), @CRLF, " |@CRLF| "))
    Case $Button2
    _INetMail(GUICtrlRead($Input2), GUICtrlRead($Input1), GUICtrlRead($Edit1))

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

    WinWaitActive("[CLASS:rctrl_renwnd32]")
    Send("^{End}")
    Send("{ALTDOWN}h{ALTUP}s")
    WinActive("classname=Net UI Tool Window","")
    Send("{ENTER}")
    sleep(500)
    Send("!s")
    EndSwitch
    WEnd

    [/autoit]

    VG,
    Dino

  • die lösung aller fragen :D


    Spoiler anzeigen
    [autoit]

    Global $section, $combodata
    $section = IniReadSection(@ScriptDir & "\Email.ini", "Emails")
    Dim $Checkbox[$Section[0][0]+1]
    _ArraySort($section, 0, 0, 0, 0)

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

    $Form1 = GUICreate("Email Prog", 400, Round($section[0][0]/2)*20+280)
    For $i = 1 To $Section[0][0]
    $Checkbox[$i] = GUICtrlCreateCheckbox($Section[$i][0], 205 - Mod($i, 2)*200, 5 + (Round($i/2) - 1)*20, 190, 25)
    Next
    $label2 = GUICtrlCreateLabel("Betreff:", 5, 20 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    $Input1 = GUICtrlCreateInput(IniRead("Email.ini", "Standards", "Betreff", ""), 5, 40 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    $label2 = GUICtrlCreateLabel("Nachrichttext:", 5, 75 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    $Edit1 = GUICtrlCreateEdit(StringReplace(IniRead("Email.ini", "Standards", "Nachricht", ""), " |@CRLF| ", @CRLF) , 5, 95 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 100)
    $label3 = GUICtrlCreateLabel("Empfänger:", 5, 205 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    $Input2 = GUICtrlCreateInput("", 5, 220 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    $Button1 = GUICtrlCreateButton("Standards speichern", 5, 250 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 125, 25)
    $Button2 = GUICtrlCreateButton("Email senden", 135, 250 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 130, 25)
    $Button3 = GUICtrlCreateButton("ini öffnen", 270, 250 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 125, 25)
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Checkbox[1] To $Checkbox[$Section[0][0]]
    $emails = ""
    For $i = 1 To $Section[0][0]
    If BitAnd(GUICtrlRead($Checkbox[$i]), $GUI_CHECKED) Then
    $emails &= $Section[$i][1] & "; "
    EndIf
    Next
    Guictrlsetdata($Input2, $emails)
    Case $Button1
    IniWrite("Email.ini", "Standards", "Betreff", GUICtrlRead($Input1))
    IniWrite("Email.ini", "Standards", "Nachricht", StringReplace(GUICtrlRead($Edit1), @CRLF, " |@CRLF| "))
    Case $Button2
    _INetMail(GUICtrlRead($Input2), GUICtrlRead($Input1), GUICtrlRead($Edit1) & @CRLF & @CRLF)
    WinWaitActive("[CLASS:rctrl_renwnd32]")
    Send("^{End}")
    Send("!eso")
    WinWait("Wählen Sie eine Signatur", "")
    ControlClick("Wählen Sie eine Signatur", "", "[CLASS:Button; INSTANCE:4]")
    Case $Button3
    Shellexecute(@ScriptDir & "\Email.ini")
    EndSwitch
    WEnd

    [/autoit]


    1. is bissl komplizierter, :D
    muss man viel anpassen...

    2. siehe script^^

    3. shellexecute, wieder siehe script ;)


    PS: was du geändert hattest musst du wieer ändern, also das mit ALT+H+S+Enter und so, hatte ja leider nur mein script

  • 1 und 3 sind OK :thumbup:

    zu 2: ERROR: _ArraySort(): undefined function.
    _ArraySort($section, 0, 0, 0, 0)

    Gesamtcode:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <Inet.au3>
    Global $section, $combodata
    $section = IniReadSection("Email.ini", "Emails")
    Dim $Checkbox[$Section[0][0]+1]
    _ArraySort($section, 0, 0, 0, 0)

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

    $Form1 = GUICreate("Email Prog", 400, Round($section[0][0]/2)*20+290)
    For $i = 1 To $Section[0][0]
    $Checkbox[$i] = GUICtrlCreateCheckbox($Section[$i][0], 205 - Mod($i, 2)*200, 5 + (Round($i/2) - 1)*20, 190, 25)
    Next
    $label1 = GUICtrlCreateLabel("_________________________________________________________________", 5, (Mod($section[0][0], 2) +Round($i/2) - 1)*20 +4, 390, 25)
    $label2 = GUICtrlCreateLabel("Betreff:", 5, 18 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Input1 = GUICtrlCreateInput(IniRead("Email.ini", "Standards", "Betreff", ""), 5, 35 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetBkColor(-1, 0xFFFFE1)
    $label2 = GUICtrlCreateLabel("Nachrichttext:", 5, 78 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Edit1 = GUICtrlCreateEdit(StringReplace(IniRead("Email.ini", "Standards", "Nachricht", ""), " |@CRLF| ", @CRLF) , 5, 95 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 100)
    GUICtrlSetBkColor(-1, 0xFFFFE1)
    $label3 = GUICtrlCreateLabel("Empfänger:", 5, 213 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Input2 = GUICtrlCreateInput("", 5, 230 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $Button1 = GUICtrlCreateButton("Standards speichern", 5, 260 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 150, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button3 = GUICtrlCreateButton("ini öffnen", 170, 260 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 90, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button2 = GUICtrlCreateButton("Email senden", 275, 260 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 120, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetBkColor(-1, 0xC0DCC0)
    GUISetState(@SW_SHOW)

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

    ;~ $Form1 = GUICreate("Email Prog", 400, Round($section[0][0]/2)*20+280)
    ;~ For $i = 1 To $Section[0][0]
    ;~ $Checkbox[$i] = GUICtrlCreateCheckbox($Section[$i][0], 205 - Mod($i, 2)*200, 5 + (Round($i/2) - 1)*20, 190, 25)
    ;~ Next
    ;~ $label2 = GUICtrlCreateLabel("Betreff:", 5, 20 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    ;~ GUICtrlSetColor(-1, 0x1B79D9)
    ;~ $Input1 = GUICtrlCreateInput(IniRead("Email.ini", "Standards", "Betreff", ""), 5, 40 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    ;~ $label2 = GUICtrlCreateLabel("Nachrichttext:", 5, 75 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    ;~ GUICtrlSetColor(-1, 0x1B79D9)
    ;~ $Edit1 = GUICtrlCreateEdit(StringReplace(IniRead("Email.ini", "Standards", "Nachricht", ""), " |@CRLF| ", @CRLF) , 5, 95 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 100)
    ;~ $label3 = GUICtrlCreateLabel("Empfänger:", 5, 205 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    ;~ GUICtrlSetColor(-1, 0x1B79D9)
    ;~ $Input2 = GUICtrlCreateInput("", 5, 220 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    ;~ $Button1 = GUICtrlCreateButton("Standards speichern", 5, 250 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 125, 25)
    ;~ $Button2 = GUICtrlCreateButton("Email senden", 135, 250 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 130, 25)
    ;~ $Button3 = GUICtrlCreateButton("ini öffnen", 270, 250 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 125, 25)
    ;~ GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Checkbox[1] To $Checkbox[$Section[0][0]]
    $emails = ""
    For $i = 1 To $Section[0][0]
    If BitAnd(GUICtrlRead($Checkbox[$i]), $GUI_CHECKED) Then
    $emails &= $Section[$i][1] & "; "
    EndIf
    Next
    Guictrlsetdata($Input2, $emails)
    Case $Button1
    IniWrite("Email.ini", "Standards", "Betreff", GUICtrlRead($Input1))
    IniWrite("Email.ini", "Standards", "Nachricht", StringReplace(GUICtrlRead($Edit1), @CRLF, " |@CRLF| "))
    Case $Button2
    _INetMail(GUICtrlRead($Input2), GUICtrlRead($Input1), GUICtrlRead($Edit1))

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

    WinWaitActive("[CLASS:rctrl_renwnd32]")
    Send("^{End}")
    Send("{ALTDOWN}h{ALTUP}s")
    WinActive("classname=Net UI Tool Window","")
    Send("{ENTER}")
    sleep(500)
    Send("!s")
    Case $Button3
    Shellexecute(@ScriptDir & "\Email.ini")
    EndSwitch
    WEnd

    [/autoit]
  • ups sry da hatte ich die includes vergessen:

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <Inet.au3>
    Global $section, $combodata
    $section = IniReadSection(@ScriptDir & "\Email.ini", "Emails")
    Dim $Checkbox[$Section[0][0]+1]
    _ArraySort($section, 0, 0, 0, 0)

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

    $Form1 = GUICreate("Email Prog", 400, Round($section[0][0]/2)*20+280)
    For $i = 1 To $Section[0][0]
    $Checkbox[$i] = GUICtrlCreateCheckbox($Section[$i][0], 205 - Mod($i, 2)*200, 5 + (Round($i/2) - 1)*20, 190, 25)
    Next
    $label2 = GUICtrlCreateLabel("Betreff:", 5, 20 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    $Input1 = GUICtrlCreateInput(IniRead("Email.ini", "Standards", "Betreff", ""), 5, 40 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    $label2 = GUICtrlCreateLabel("Nachrichttext:", 5, 75 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    $Edit1 = GUICtrlCreateEdit(StringReplace(IniRead("Email.ini", "Standards", "Nachricht", ""), " |@CRLF| ", @CRLF) , 5, 95 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 100)
    $label3 = GUICtrlCreateLabel("Empfänger:", 5, 205 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    $Input2 = GUICtrlCreateInput("", 5, 220 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 390, 25)
    $Button1 = GUICtrlCreateButton("Standards speichern", 5, 250 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 125, 25)
    $Button2 = GUICtrlCreateButton("Email senden", 135, 250 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 130, 25)
    $Button3 = GUICtrlCreateButton("ini öffnen", 270, 250 + (Mod($section[0][0], 2) +Round($i/2) - 1)*20, 125, 25)
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Checkbox[1] To $Checkbox[$Section[0][0]]
    $emails = ""
    For $i = 1 To $Section[0][0]
    If BitAnd(GUICtrlRead($Checkbox[$i]), $GUI_CHECKED) Then
    $emails &= $Section[$i][1] & "; "
    EndIf
    Next
    Guictrlsetdata($Input2, $emails)
    Case $Button1
    IniWrite("Email.ini", "Standards", "Betreff", GUICtrlRead($Input1))
    IniWrite("Email.ini", "Standards", "Nachricht", StringReplace(GUICtrlRead($Edit1), @CRLF, " |@CRLF| "))
    Case $Button2
    _INetMail(GUICtrlRead($Input2), GUICtrlRead($Input1), GUICtrlRead($Edit1) & @CRLF & @CRLF)
    WinWaitActive("[CLASS:rctrl_renwnd32]")
    Send("^{End}")
    Send("!eso")
    WinWait("Wählen Sie eine Signatur", "")
    ControlClick("Wählen Sie eine Signatur", "", "[CLASS:Button; INSTANCE:4]")
    Case $Button3
    Shellexecute(@ScriptDir & "\Email.ini")
    EndSwitch
    WEnd

    [/autoit]