_InetSmtpMail will nicht , fehlercode 50

  • hi ich möchte einen kleinen einfachen emailsender coden besser gesagt habe es , aber ich bekomme dauernd fehlercode 50 :(
    hier der code:

    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_outfile=automail.exe
    #AutoIt3Wrapper_Res_Fileversion=0.0.0.5
    #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
    #AutoIt3Wrapper_Res_LegalCopyright=Jeahaha
    #AutoIt3Wrapper_Res_Language=1031
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

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

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <File.au3>
    #include <INet.au3>
    #Region ### START Koda GUI section ### Form=c:\users\timo2\desktop\programieren\autoit\win live auto mail\form1.kxf
    $Form1 = GUICreate("E-mailer", 422, 212, 342, 126)
    $email1 = GUICtrlCreateInput("", 32, 0, 121, 21)
    $Label1 = GUICtrlCreateLabel("@", 160, 0, 20, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $email2 = GUICtrlCreateInput("", 184, 0, 57, 21)
    $Label2 = GUICtrlCreateLabel("An:", 0, 0, 28, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Text = GUICtrlCreateEdit("", 0, 24, 417, 153)
    GUICtrlSetData(-1, "")
    $Button1 = GUICtrlCreateButton("Senden", 8, 184, 75, 25, $WS_GROUP)
    $Button2 = GUICtrlCreateButton("Optionen", 344, 184, 75, 25, $WS_GROUP)
    $Button3 = GUICtrlCreateButton("Addressen", 144, 184, 139, 25, $WS_GROUP)
    $Button4 = GUICtrlCreateButton("Auswählen", 248, 0, 171, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    $settings = "settings.properties"
    FileOpen( $settings )
    $smtpserver = FileReadLine( $settings , 1 )
    $smtplogin = FileReadLine( $settings , 2 )
    $smtppasswort = FileReadLine( $settings , 3 )
    $vonadresse = FileReadLine( $settings , 4 )
    $adressenordner = FileReadLine( $settings , 5 )
    $vonname = FileReadLine( $settings , 6 )

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

    $an1 = GUICtrlRead( $email1 )
    $an2 = GUICtrlRead( $email2 )
    $an = $an1 & "@" & $an2

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    FileClose( $settings )
    Exit
    Case $Button1
    $Response = _INetSmtpMail( $smtpserver , $vonname , $vonadresse , $an , "test" , "hallo")
    $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
    Case $Button2
    FileClose( $settings )
    Run( "optionen.exe" )
    Exit
    Case $Button3
    Run( "adressen.exe" )
    Case $Button4
    $addr = FileOpenDialog( "Addresse auswählen" , @ScriptDir & "/adressen/" , "(*.txt)" )
    FileOpen( $addr )
    $1 = FileReadLine( $addr , 1 )
    $2 = FileReadLine( $addr , 2 )
    GUICtrlSetData( $email1 , $1 )
    GUICtrlSetData( $email2 , $2 )
    EndSwitch
    WEnd

    [/autoit]
  • Hast du denn einen SMTP-Server der keine Anmeldung (Passwort) benötigt? Wenn nein benutze die Sufu mit dem Stichwort _INetSmtpMailCom. Ich habe erst vor kurzem einen Beitrag dazu geschrieben,

    mfg autoBert