Mailversand über INetSmtpMail

  • hallo,

    suche für folgendes vorhaben eine lösung:
    info: die derzeitige lösung ist zu statisch

    ich habe eine ini datei (beispiel):

    Spoiler anzeigen


    [A1]
    Key03 = ""adresse1@xy.de;adresse3@xy.de;adresse3@xy.de""
    Key04 = ""\\pc1\xyz_00.pdf""

    [A2]
    Key05 = ""adresse1@xy.de;adresse3@xy.de;adresse3@xy.de""
    Key06 = ""\\pc1\xyz_01.pdf""

    [A3]
    Key03 = ""adresse1@xy.de;adresse3@xy.de;adresse3@xy.de""
    Key04 = ""\\pc1\xyz_03.pdf""

    und kann die felder auch mit iniread auslesen. und den variablen

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    $mailto_01 = IniRead("C:\xxx.ini", "A1", "key03", "NotFound")
    $path1 = IniRead("C:\xxx.ini", "A1", "key04", "NotFound")

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

    ;##################################
    ; Variables
    ;##################################
    $s_SmtpServer = "xx.xx.xx.xx" ; address for the smtp-server to use - REQUIRED
    $s_FromName = "xxx.xxx.de" ; name from who the email was sent
    $s_FromAddress = "xxx.xxx.de" ; address from where the mail should come
    $s_ToAddress = $mailto_01 ; destination address of the email - REQUIRED
    $s_Subject = "xxx" ; subject from the email - can be anything you want it to be
    $as_Body = ""; the messagebody from the mail - can be left blank but then you get a blank mail
    $s_AttachFiles = $path1 ; the file you want to attach- leave blank if not needed
    $s_CcAddress = "" ; address for cc - leave blank if not needed
    $s_BccAddress = "" ; address for bcc - leave blank if not needed
    $s_Username = "xxxx" ; username for the account used from where the mail gets sent - Optional (Needed for eg GMail)
    $s_Password = "xxxxxxxxxx" ; password for the account used from where the mail gets sent - Optional (Needed for eg GMail)
    $IPPort = 25 ; port used for sending the mail
    $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS
    ;~ $IPPort=465 ; GMAIL port used for sending the mail
    ;~ $ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS

    [/autoit]


    wie kann ich das ganze in eine schleife packen? :?:

    sozusagen soll die schleife erst abschnitt A1 der ini abarbeiten und die mail mit entsprechendem anhang versenden, danach A2 usw.

    in der derzeitigen lösung habe ich die funktion einfach umbenannt und nochmals aufgerufen.

    danke im voraus

    gruß gmmg