INetSmtpMail kommt nich an

  • mein Script sieht zur zeit noch so aus:

    [autoit]

    #include <Inet.au3>
    _INetSmtpMail("smtp.web.de", @UserName, "Dummy@PC.de", "dustin.baum@web.de", "PC-Daten von " & @UserName, "Test")

    [/autoit]


    Meine Firewall hat mich auch scchon gewarnt also sollte die E-Mail doch gesendet worden sein.
    Oder wie lange braucht so eine E-Mail?

  • ich hab´s jetzt ohne Firewall gemacht und als "$s_FromAdress" meine E-Mail Adresse angegeben.
    bei web.de habe ich auch den punkt "nicht an eigene Adresse senden" das Häkchen weggemacht.
    funktioniert immernochnicht. :hm:

    Einmal editiert, zuletzt von Dustin (17. März 2007 um 14:01)

    • Offizieller Beitrag

    Hi,

    kann es leider nicht testen, da ich an meinem Firmenrechner die Firewall nicht ausstellen kann.

    Aber wenn du es laut BSp ausfüllst, sollte es funktionieren. Zeig mal deinen Code. (Email und passwort bitt xxx :) )

    Oder mal sowas probieren:

    Spoiler anzeigen
    [autoit]

    #include<IE.au3>
    ; Set Variables
    ;==============================================
    ; For Use with IE.au3 version 2.0 !
    ; This code is (C) Brad Reddicopp 2006
    $message = "Your message here"
    $to = "vibroei@gmx.de"
    $from = "billgates@microsoft.com"
    $from_name = "Bill Gates"
    $subject = "Wow!"
    $silent = 1; 0 = No Message Boxes 1 = Message boxes
    ;==============================================
    ; End Veriables
    $i = 1
    $oIE = _IECreate ("http://www.fake-mailer.com/fmlite/", 0, 0)
    ; get pointers to the login form and username and password fields
    $o_form = _IEFormGetCollection ($oIE, 0)
    $o_name = _IEFormElementGetObjByName ($o_form, "name")
    $o_to = _IEFormElementGetObjByName ($o_form, "to")
    $o_subject = _IEFormElementGetObjByName ($o_form, "subject")
    $o_from = _IEFormElementGetObjByName ($o_form, "from")
    $o_message = _IEFormElementGetObjByName ($o_form, "message")

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

    If @error = 1 Then
    MsgBox(0, "Error","No connection")
    Exit(0)
    EndIf

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

    ; Set field values and submit the form
    _IEFormElementSetValue ($o_name, $from_name)
    _IEFormElementSetValue ($o_to, $to)
    _IEFormElementSetValue ($o_subject, $subject)
    _IEFormElementSetValue ($o_from, $from)
    _IEFormElementSetValue ($o_message, $message)
    _IEFormSubmit ($o_form)

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

    While $i = 1
    If WinExists("Email was sent - Microsoft Internet Explorer") Then
    $i = 0
    ExitLoop
    EndIf
    If WinExists("http://www.fake-mailer.com/fmlite/sendMail.php") Then
    WinKill("http://www.fake-mailer.com/fmlite/sendMail.php")
    If $silent = 1 Then MsgBox(16, "Email Sender", "Error Sending Email")
    $i = 0
    Exit
    EndIf
    WEnd
    If $silent = 1 Then MsgBox(64, "Email Sender", "Email Was Sent")
    WinKill("Email was sent - Microsoft Internet Explorer")

    [/autoit]
  • OK der code:

    [autoit]

    #include <Inet.au3>
    _INetSmtpMail("smtp.web.de", @UserName, "dustin.baum@web.de", "dustin.baum@web.de", "PC-Daten von " & @UserName, "Text")

    [/autoit]
    • Offizieller Beitrag

    Hi,

    hier noch mal 2 Möglichkeiten, die eigentlich funktioieren sollten(wie gesagt, ich kann nicht testen)

    Spoiler anzeigen
    [autoit]

    #include <INet.au3>

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

    $s_SmtpServer = "smtp.web.de"
    $s_FromName = @UserName
    $s_FromAddress = "dustin.baum@web.de"
    $s_ToAddress = "dustin.baum@web.de"
    $s_Subject = "PC-Daten von " & @UserName
    Dim $as_Body[2]
    $as_Body[0] = "Testing the new email udf"
    $as_Body[1] = "Second Line"
    $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
    $err = @error
    If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
    Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
    EndIf

    [/autoit]

    oder mal dies ausfüllen:

    Spoiler anzeigen
    [autoit]

    #include<file.au3>
    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

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

    $rc = _INetSmtpMailCom('', "", "", "", "", "Test <b>Ich habs geschafft!</b>", "", "","", "", "")
    If @error then
    msgbox(0,"Error sending message","Error code:" & @error & " Description:" & $rc)
    EndIf

    [/autoit] [autoit][/autoit] [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 = "")
    $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.Cc = $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") = 25
    ;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
    ;Update settings
    $objEmail.Configuration.Fields.Update
    ; Sent the Message
    $objEmail.Send
    if @error then
    SetError(2)
    return $oMyRet[1]
    EndIf
    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;==>MyErrFunc

    [/autoit]

    So long,

    Mega

  • Danke @th.meger deine zweite Möglichkeit hat funktioniert.

    noch eine frage: In der Func _INetSmtpMailCom stehen die Zeilen

    [autoit]

    $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") = 25
    ;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

    [/autoit]


    Ich bin ja neugierig und habe mal nachgesehen auf der Seite "http://schemas.microsoft..."
    die Seite existiert laut InetExplorer garnicht und trotzdem kommt die E-Mail bei mir an ?(
    Was macht das Script denn auf der seite?

    Und noch eine frage:
    muss eine existierende E-Mail als absender angegeben Werden?
    oder kann man irgendeine angeben?

    Einmal editiert, zuletzt von Dustin (19. März 2007 um 14:33)

  • du kansnt in htaccess einstellen welche datein nicht sichtbar sein sollen, meines wissens :D

  • joa da hat der meger recht...bei dem script brauchst du beim entsprechenen anbierter eine gültige mail-addy...
    ich verschick meine mails zurzeit nur per php da kann ich variable absender eintragen xD^^ *Spam lässt grüßen*
    topic->solved
    der snoozer

  • Ich kenn mich nicht so gut mit PC aus wie manch anderer hier im forum.
    kann mir dan einer mal ein paar sachen erklähren?

    1. Was iss "htaccess"?

    2.

    Zitat

    Ja, ich denke du brauchst eine gültige Adresse, ansonsten hast du auch keinen SMTP.


    Wie kriegt man denn eine "gültige Adresse"?

    3. Wie verschickt man E-Mails per php?

    snoozer was meist du mit topic->solved
    hier im forum oda was?

  • also.....
    1) htaccess datein sind dateien die auf einem server liegen ( auch localhost möglich) die den zurgiff auf bestimmte seiten regeln sprich eine art konfigurationsdatei die sagt dass du seite xyz nicht per browser aufrufen kannst es jedoch andere möglichkeiten (wie hier: erstellung eines COM objektes) den zugriff auf die seite ermöglichen.....das sagt wiki zu htaccess
    2) ganz einfach bei web.de oder gmx.de oder wo auch immer anmelden -> damit hast du einen gültigen smpt zu finden sind die smpt-server meistens auf den entsprechenden seiten oder bei google einfach nach "smpt <meinanbieter>" suchen....
    3) das ist im grunde auch ganz einfach....was du dazu brauchst ist ein hoster der was mit php anfangen kann...free PHP hoster...*zu empfehlen sind pytal und ohost bzw funpic*....so dann musste noch ne php datei erstellen (mit texteditor oder whatever *zu empfehlen dreamweaver*) und dir einfach folgenden link(php ref mail) anschauen deine datei auf den server laden *zu empfehlen FileZilla* und per firefox aufrufen....das blöde ist nur dass bei so gut wie allen free-php-webhostern dein nick oder registrierungsnummer mitgeschickt wird damit du kein blödsinn machst.....(also es ist nen problem für mich aber vll nicht für jeden xD)

  • OK danke bin Mal wieder ein bisschen schlauer geworden.

    Aber huggy hat gesagt:

    Zitat

    du kannst in htaccess einstellen welche Dateien nicht sichtbar sein sollen, meines wissens :D


    wie und wo kann man das denn dann einstellen?

    2 Mal editiert, zuletzt von Dustin (21. März 2007 um 14:55)