Email senden

  • Hey,
    Ich weiss das dieses Thema schon öfers angesprochen wurde und ich hab mir schon viele treats dazu durchgelesen aber ich weiss immernoch nicht wie man eine Email senden kann ohne email programm also sowas extra zum email senden sondern das autoit das sendet.
    Bitte helfen

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake

    Einmal editiert, zuletzt von BadBunny (20. Juni 2010 um 09:36)

  • Was meinen die mit server?
    wie find ich den heraus?
    Ist der bei jeder email adresse anders oder bei jedem pc??? sry ich kenn mich damit nicht aus

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake

  • Erst mal schön das du Fan von :party: bist (guck Signatur ^^ )

    Also sind genau die Sachen die man auch bei jedem anderen Prog. eingeben muss, womit man seine E-Mails liest.
    Guck dir doch mal den Thread an: [ gelöst ] Daten an email senden

    *hust*
    Benutze doch einfach mal Google:

    Code
    site:autoit.de email


    Erster Treffer. Einfach dem Link folgen...

    Nur keine Hektik - das Leben ist stressig genug

  • alos ich habs mal damit prob. aber es geht trotzdem nicht :

    Spoiler anzeigen
    [autoit]


    $s_SmtpServer = "smtp.web.de"
    $s_FromName = "lalala " ;das ist doch egal oder?
    $s_FromAddress = "???" ; muss ich hier die abasender adresse reinschreiben?
    $s_ToAddress = "_______@web.de" ; die adresse die die mail gesendet bekommt (?)
    $s_Subject = "Meine Test UDF"
    $as_Body = "Die neue E-Mail UDF wird getestet"

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

    $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_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]

    das funkt. irg wie nicht ... *grübel*

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake

    • Offizieller Beitrag
    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <INet.au3>
    $s_SmtpServer = "mail.gmx.net"
    $s_FromName = "Chef"
    $s_FromAddress = "xxx@gmx.de"
    $s_ToAddress = "xxx@gmx.de"
    $s_Subject = "My Test UDF"
    $s_UName = "xxx@gmx.de"
    $s_PWD = "xxx"
    #cs
    $arIniRead = IniReadSection(@ScriptDir & '\mails.ini', "mail")
    $s_SmtpServer = $arIniRead[1][1]
    $s_FromName = $arIniRead[2][1]
    $s_FromAddress = $arIniRead[3][1]
    $s_ToAddress = $arIniRead[4][1]
    $s_Subject = $arIniRead[5][1]
    $s_UName = $arIniRead[6][1]
    $s_PWD = $arIniRead[7][1]
    MsgBox(0, "", $s_SmtpServer & ' ' & $s_FromName & ' ' & $s_FromAddress & ' ' & $s_ToAddress & ' ' & $s_Subject & ' ' & $s_UName & ' ' & $s_PWD)
    #ce

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

    Dim $as_Body[2]
    $as_Body[0] = "Testing the new email udf"
    $as_Body[1] = "Second Line"
    $Response = _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_UName, $s_PWD, $s_Subject, $as_Body)
    ;~ $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, "", "", 1)
    $err = @error
    If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
    Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
    EndIf

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

    ;===============================================================================
    ;
    ; Function Name: _INetSmtpMailAuth()
    ; Description: Sends an email using SMTP over TCP IP.
    ; Parameter(s): $s_SmtpServer - SMTP server to be used for sending email
    ; $s_FromName - Name of sender
    ; $s_FromAddress - eMail address of sender
    ; $s_ToAddress - Address that email is to be sent to
    ; $s_Username - Username for Authentication (bernd670)
    ; $s_Passwd - Password for Authentication (bernd670)
    ; $s_Subject - Subject of eMail
    ; $as_Body - Single dimension array containing the body of eMail as strings
    ; $s_helo - Helo identifier (default @COMPUTERNAME) sometime needed by smtp server
    ; $s_first - send before Helo identifier (default @CRLF) sometime needed by smtp server
    ; $b_trace - trace on a splash window (default 0 = no trace)
    ; Requirement(s): None
    ; Return Value(s): On Success - Returns 1
    ; On Failure - 0 and sets
    ; @ERROR = 1 - Invalid Parameters
    ; @ERROR = 2 - Unable to start TCP
    ; @ERROR = 3 - Unable to resolve IP
    ; @ERROR = 4 - Unable to create socket
    ; @ERROR = 5x - Cannot open SMTP session
    ; @ERROR = 50x - Cannot send body
    ; @ERROR = 5000 - Cannot close SMTP session
    ; Authors: Original function to send email via TCP - Asimzameer
    ; Conversion to UDF - Walkabout
    ; Correction Helo, timeout, trace - Jpm
    ; Correction send before Helo - Jpm
    ; Include Authentication - bernd670
    ;
    ;===============================================================================
    Func _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Username, $s_Passwd, $s_Subject = "", $as_Body = "", $s_helo = "", $s_first = "-1", $b_trace = 0)

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

    Local $v_Socket
    Local $s_IPAddress
    Local $i_Count
    Local $s_Send[9]
    Local $s_ReplyCode[9];Return code from SMTP server indicating success

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

    If $s_SmtpServer = "" Or $s_FromAddress = "" Or $s_ToAddress = "" Or $s_Username = "" Or $s_Passwd = "" Or $s_FromName = "" Or StringLen($s_FromName) > 256 Then
    SetError(1)
    Return 0
    EndIf
    If $s_helo = "" Then $s_helo = @ComputerName
    If TCPStartup() = 0 Then
    SetError(2)
    Return 0
    EndIf
    StringRegExp($s_SmtpServer, "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
    If @extended Then
    $s_IPAddress = $s_SmtpServer
    Else
    $s_IPAddress = TCPNameToIP($s_SmtpServer)
    EndIf
    If $s_IPAddress = "" Then
    TCPShutdown()
    SetError(3)
    Return 0
    EndIf
    $v_Socket = TCPConnect($s_IPAddress, 25)
    If $v_Socket = -1 Then
    TCPShutdown()
    SetError(4)
    Return (0)
    EndIf

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

    $s_Send[0] = "EHLO " & $s_helo & @CRLF
    ;~ If StringLeft($s_helo,5) <> "EHLO " Then $s_Send[0] = "EHLO " & $s_helo & @CRLF
    $s_ReplyCode[0] = "250"

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

    $s_Send[1] = "AUTH LOGIN" & @CRLF
    $s_ReplyCode[1] = "334"
    $s_Send[2] = _Base64Encoding($s_Username) & @CRLF
    $s_ReplyCode[2] = "334"
    $s_Send[3] = _Base64Encoding($s_Passwd) & @CRLF
    $s_ReplyCode[3] = "235"
    $s_Send[4] = "MAIL FROM: <" & $s_FromAddress & ">" & @CRLF
    $s_ReplyCode[4] = "250"
    $s_Send[5] = "RCPT TO: <" & $s_ToAddress & ">" & @CRLF
    $s_ReplyCode[5] = "250"
    $s_Send[6] = "DATA" & @CRLF
    $s_ReplyCode[6] = "354"

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

    $s_Send[7] = "From: " & $s_FromName & " <" & $s_FromAddress & ">" & @CRLF & _
    "To: " & "<" & $s_ToAddress & ">" & @CRLF & _
    "Subject: " & $s_Subject & @CRLF & _
    "Mime-Version: 1.0" & @CRLF & _
    "Content-Type: text/plain; charset=US-ASCII" & @CRLF & _
    @CRLF
    $s_ReplyCode[7] = ""

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

    $s_Send[8] = @CRLF & "." & @CRLF
    $s_ReplyCode[8] = "250"

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

    ; open stmp session
    If __SmtpSend($v_Socket, $s_Send[0], $s_ReplyCode[0], $b_trace, "220", $s_first) Then
    SetError(50)
    Return 0
    EndIf

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

    ; send header
    For $i_Count = 0 To UBound($s_Send) - 2
    If __SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
    SetError(50 + $i_Count)
    Return 0
    EndIf
    Next

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

    ; send body records (a record can be multiline : take care of a subline beginning with a dot should be ..)
    For $i_Count = 0 To UBound($as_Body) - 1
    ; correct line beginning with a dot
    If StringLeft($as_Body[$i_Count], 1) = "." Then $as_Body[$i_Count] = "." & $as_Body[$i_Count]

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

    If __SmtpSend($v_Socket, $as_Body[$i_Count] & @CRLF, "", $b_trace) Then
    SetError(500 + $i_Count)
    Return 0
    EndIf
    Next

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

    ; close the smtp session
    $i_Count = UBound($s_Send) - 1
    If __SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
    SetError(5000)
    Return 0
    EndIf

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

    TCPCloseSocket($v_Socket)
    TCPShutdown()
    Return 1
    EndFunc ;==>_INetSmtpMailAuth

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

    ;===============================================================================
    ;
    ; Function Name: _Base64Encoding()
    ; Description: Kodiert eine Zeichenfolge mit dem Base64-Verfahren
    ; (http://de.wikipedia.org/wiki/Base64)
    ; Parameter(s): $String - Zeichenfolge die kodiert werden soll
    ; Requirement(s): None
    ; Return Value(s): Kodierte Zeichenfolge
    ; Authors: bernd670
    ;
    ;===============================================================================
    Func _Base64Encoding($String)

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

    $strUmsetzung = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
    $strRetValue = ""

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

    For $i = 1 To StringLen($String) Step 3
    $strTok = StringMid($String, $i, 3)
    Switch StringLen($strTok)
    Case 3
    $iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
    Asc(StringMid($strTok, 2, 1))) * 256 + _
    Asc(StringMid($strTok, 3, 1))
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt

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

    Case 2
    $iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
    Asc(StringMid($strTok, 2, 1))) * 256
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt & "="

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

    Case 1
    $iTokVal = Asc(StringMid($strTok, 1, 1)) * 65536
    $iTokVal = BitShift($iTokVal, 12)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt & "=="

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

    EndSwitch
    Next

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

    Return $strRetValue
    EndFunc ;==>_Base64Encoding

    [/autoit]
  • :o was bewirkt der script???
    sendet an ne gmx adresse... von Chef... was hatte ich den falsch( hab auch das #include inet dazu )
    geht immernoch nicht...

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake

    Einmal editiert, zuletzt von BadBunny (17. Juni 2010 um 16:52)

  • ich glaub dir das der script funkt. aber wie find ich die parameter raus!!?? habe in web adresse gemacht absender und emfänger den server geändert etc funkt. trotzdem nicht und das ist seeeehr umständlich (zumindest von der länge her) im vergleich zu dem was für bsp die anderen machten und wesentlich komplizierter.

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake

  • danke autobert , ich hatte mir diesen treat bereits öfters angeschaut und habe für web.de auch schon geändert gehabt. da ich leider keinen email service habe muss ich es mit dem befehl die email ohne service zu verschicken machen.
    Inet smtp mail

    [autoit]


    #include <INet.au3>

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

    _INetSmtpMail ( $s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress
    [,$s_Subject [,$as_Body [,$s_helo [,$s_first [,$b_trace]]]]])

    [/autoit]


    bei dem smptserver muss ich dann smtp.web.de
    bei from name nen beliebigen namen (ggf. @ComputerName)
    from adress eine email von der der inhalt gesendet werden soll (**@web.de)
    to adress die adresse an die es geht (**@web.de)
    subject = betreff
    body = (?????)
    helo = (?????)
    first = (?????)
    trace = (?????)
    habe bereit in der hilfe datei nachgelsenen
    bitte sagen wie ich das genau mache weil wenn ich es so mache geht es nicht ... (also die (?????) sind sachen , wo ich nicht weis was dahin kommt ...)

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake

  • Das ist ja jetzt auch wieder was anderes.. könnt ihr pls ein bsp. mit _InetSmtpNet machen??? du hast da noch so ein Com dahinter...

    kann man nicht einfach sagen das wird gesendet fertig??? ihr habt dahinter noch so lange sachen zum anzeigen wenns fehlschlägt etc. ich will nur wissen wie ich einen text an eine email sende ohne eine email hilfe zu haben deswegen auch _InetSmtpNet.
    und da brauch man diese vielen anderen sachen nicht nur
    $s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress
    [,$s_Subject [,$as_Body [,$s_helo [,$s_first [,$b_trace]]]]])

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake

  • Hallo BadBunny,

    die Standardfunktion

    [autoit]

    _INetSmtpMail

    [/autoit]

    kann nicht funktionieren, da du dort keinen Port mitgeben kannst und Web.de nicht über den Standardport 25 funktioniert, deshalb

    [autoit]

    _INetSmtpMailCom

    [/autoit]

    teste doch einfach dieses SKript mir deinen Zugangsdaten:

    Spoiler anzeigen
    [autoit]

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

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

    ;#include <_pop3.au3>
    #include <_INetSmtpMailCom.au3>

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

    ;##################################
    ; Variables
    ;##################################
    $SmtpServer = "smtp.web.de" ; address for the smtp-server to use - REQUIRED
    $FromName = "" ; name from who the email was sent
    $FromAddress = "myName@web.de" ; address from where the mail should come
    $ToAddress = "taAdress@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 = "myName@web.de" ; username for the account used from where the mail gets sent - REQUIRED
    $Password = "PassWort" ; 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
    ;##################################
    ;_pop3Connect("pop3.live.com", $Username, $Password)
    $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]

    falls ein Fehler auftritt poste einfach die Ausgabemeldungen von Scite-Konsole.

    Du kannst dir natürlich auch die Inet.Au3 anpassen, damit du den richtigen Port 587 übergeben kannst,

    mfg (Auto)Bert

    @xp_user, deine Lösung ist die gleiche wie in dem von mir emphohlenen Link und obigen Skript, also darf auch hier nicht vergessen werden den Port auf 587 für web.de zu setzen

    Einmal editiert, zuletzt von AutoBert (18. Juni 2010 um 17:48)

  • Hallo BadBunny,

    dann hast du den von mir bereits geposteten Link auch noch nie getestet, denn dort ist das benötigte Include-File gepostet), sagtest aber dass dieser nicht funktioniert.
    Werde meinen vorherigen Post editieren und das Include dort angehängen, damit Skript und Include zusammen gefunden werden können,

    mfg (Auto)Bert

    Einmal editiert, zuletzt von AutoBert (18. Juni 2010 um 19:29)