SMTP Mail Versandt mit AUTH-LOGIN
Übersicht

![]() |
SparxBetreff: SMTP Mail Versandt mit AUTH-LOGIN |
![]() Antworten mit Zitat ![]() |
---|---|---|
Habs nur bei GMX getestet, sollte aber auch bei allen andern smtp server funzen:
Code: [AUSKLAPPEN] Function smtpSendMail(server$, von_adresse$, password$, an_adresse$, subject$, mailtext$)
com2 = OpenTCPStream(server$,25) ReadLine(com2) WriteLine com2,"AUTH LOGIN" ReadLine(com2) WriteLine com2,b64enc(von_adresse) ReadLine(com2) WriteLine com2,b64enc(password) ReadLine(com2) WriteLine com2,"HELO EGAL" ReadLine(com2) WriteLine com2,"MAIL FROM: " + von_adresse$ ReadLine(com2) WriteLine com2,"RCPT TO: "+an_adresse$ ReadLine(com2) WriteLine com2,"DATA" ReadLine(com2) WriteLine com2, "Date: " + CurrentDate$ () WriteLine com2, "From: " + von_name$ + " <" + von_adresse$ + ">" WriteLine com2, "To: " + an_name$ + " <" + an_adresse$ + ">" WriteLine com2, "Subject: " + subject$ WriteLine com2, "X-Mailer: EGAL" i = 0 Repeat WriteLine com2, stringausstring$(mailtext$, i, 0) i = i + 1 Until Len(stringausstring$(mailtext$, i, 0)) = 1 And stringausstring$(mailtext$, i, 0) = "0" WriteLine com2, "." ReadLine(com2) WriteLine com2, "QUIT" ReadLine(com2) CloseTCPStream(com2) End Function Function stringausstring$(s$, stelle, trenncode) anzahl = 1 ; Anzahl der Textstellen letzteskomma = 1 ; Position des letzten Kommas For i = 1 To Len(s$) If Asc(Mid(s$, i, 1)) = trenncode Or i = Len(s$) Then ; Wenn ein Trenncode erreicht ist If anzahl = stelle Then ; Wenn diese Stelle die angegebene ist... s2$ = Mid(s$, letzteskomma, i-letzteskomma) ; Text extrahieren If i = Len(s$) Then s2$ = Mid(s$, letzteskomma, i-(letzteskomma-1)) ; Wenn der Text der letzte im String ist, etwas anders extrahieren If Len(Mid(s$,letzteskomma,i-letzteskomma)) = 1 Then s2$ = Chr$(0) EndIf letzteskomma = i+1 ; Weitergehen im String solange der Text noch nicht erreicht ist anzahl = anzahl + 1 EndIf Next If stelle > (anzahl-1) Then Return "0" Return s2$ End Function Function b64enc$(a$) b64$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" m$="" f$="" largo=Len(a$) ;Encode a$ into one long string of bits cx$="" For encode=1 To largo x$=Mid$(a$,encode,1) ;get one char at a time Tx=Asc(x$) ;Tx = ASCII code b$=Bin$(Tx) ;convert Tx into string of 32 bits b$=Right$(b$,8) ;get the right most 8 bits out of the 32 bits cx$=cx$+b$ ;add string of 8 bits to cx$ Next ;largo = number of bits stored in cx$ largo=Len(cx$) For encode=1 To largo Step 6 x$=Mid$(cx$,encode,6) bbb=Len(x$) bbbx=6-bbb ;check for 6 bits ;If not full 6 bits at end of bit string, then add "=" to end of encoded string If bbbx>0 Then f$="=" EndIf x$=x$ + Left$("00000000",bbbx) ;pad with zeroes to make 6 bits res=0 For y=0 To 5 by = Asc(Mid$(x$, 6-y, 1)) - 48 ;get bits from right to left (least significant to most) res = res + ( 2^y * by) ;raise to power of 2 and add to res (result) Next m$=m$+Mid$(b64$,res+1,1)+f$ Next Return m$ End Function Dieser Code ist erstellt auf Basis anderer Codes. |
||
User posted image |
![]() |
Markus2 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Habs noch nicht ausprobiert aber kann ich bestimmt mal gebrauchen ! ![]() |
||
![]() |
Sparx |
![]() Antworten mit Zitat ![]() |
---|---|---|
So, hab einige Fehler entdeckt und ausgebessert:
Code: [AUSKLAPPEN] Function smtpSendMail(server$, von_adresse$, password$, an_adresse$, subject$, mailtext$) com2 = OpenTCPStream(server$,25) ReadLine(com2) WriteLine com2,"AUTH LOGIN" ReadLine(com2) WriteLine com2,b64enc(von_adresse) ReadLine(com2) WriteLine com2,b64enc(password) ReadLine(com2) WriteLine com2,"HELO Chess-Mail" ReadLine(com2) WriteLine com2,"MAIL FROM: " + von_adresse$ ReadLine(com2) WriteLine com2,"RCPT TO: "+an_adresse$ ReadLine(com2) WriteLine com2,"DATA" ReadLine(com2) WriteLine com2, "Date: " + CurrentDate$ () WriteLine com2, "From: " + von_name$ + " <" + von_adresse$ + ">" WriteLine com2, "To: " + an_name$ + " <" + an_adresse$ + ">" WriteLine com2, "Subject: " + subject$ WriteLine com2, "X-Mailer: Chess-Mail" WriteLine com2, "" WriteLine com2, mailtext$ WriteLine com2, "." ReadLine(com2) WriteLine com2, "QUIT" ReadLine(com2) CloseTCPStream(com2) End Function Function b64enc$(a$) b64$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" m$="" f$="" largo=Len(a$) ;Encode a$ into one long string of bits cx$="" For encode=1 To largo x$=Mid$(a$,encode,1) ;get one char at a time Tx=Asc(x$) ;Tx = ASCII code b$=Bin$(Tx) ;convert Tx into string of 32 bits b$=Right$(b$,8) ;get the right most 8 bits out of the 32 bits cx$=cx$+b$ ;add string of 8 bits to cx$ Next ;largo = number of bits stored in cx$ largo=Len(cx$) For encode=1 To largo Step 6 x$=Mid$(cx$,encode,6) bbb=Len(x$) bbbx=6-bbb ;check for 6 bits ;If not full 6 bits at end of bit string, then add "=" to end of encoded string If bbbx>0 Then f$="=" EndIf x$=x$ + Left$("00000000",bbbx) ;pad with zeroes to make 6 bits res=0 For y=0 To 5 by = Asc(Mid$(x$, 6-y, 1)) - 48 ;get bits from right to left (least significant to most) res = res + ( 2^y * by) ;raise to power of 2 and add to res (result) Next m$=m$+Mid$(b64$,res+1,1)+f$ Next Return m$ End Function Wenn man beim mailtext eine neue Zeile haben will, einfach Chr(10) anfuegen. |
||
User posted image |
walskiEhemaliger Admin |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Dabei schenkst du aber einer Tatsache keinerlei Bedeutung:
Bei vielen Provider ist Von_Adresse <> Benutzer Code: [AUSKLAPPEN] Function smtpSendMail(server$, user$, password$, von_adresse$, an_adresse$, subject$, mailtext$) com2 = OpenTCPStream(server$,25) ReadLine(com2) WriteLine com2,"AUTH LOGIN" ReadLine(com2) WriteLine com2,b64enc(user$) Damit sollte es dann aber gehen ![]() Nichts weltbewegendes aber naja, is halt so. walski |
||
buh! |
![]() |
Sparx |
![]() Antworten mit Zitat ![]() |
---|---|---|
AEHM Walsi: BEi Smtp wird der Login IMMER mit der emailadresse Ausgefuehrt! Jedenfalls habe ich es so verstanden. | ||
User posted image |
walskiEhemaliger Admin |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Nein, das kann ich klar dementieren ![]() Habs ebe getestet, eine User Variable sollte schon drin sein! walski |
||
buh! |
lettorTrepuS |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
-aus Sicherheitsgründen gelöscht- Diese Information ist mit Ihrer Sicherheitsfreigabe leider nicht erhältlich, Bürger. | ||
![]() |
Sparx |
![]() Antworten mit Zitat ![]() |
---|---|---|
Nein, das ist falsch. Das ist teil des SMTP-AUTH zb. bei gmx. ohne dieses Auth kann man keine emails versenden. | ||
User posted image |
lettorTrepuS |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
-aus Sicherheitsgründen gelöscht- Diese Information ist mit Ihrer Sicherheitsfreigabe leider nicht erhältlich, Bürger. | ||
![]() |
Sparx |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ein emailaccoutn ist was ganz naderes als SMTP-AUTH | ||
User posted image |
darkshadow |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Es war damals so und hat heut nicht mehr so zu sein. Es gibt sogar Websites, wo, wenn ich meine Mailaddy eingebe und die wohl bestimmte Sachen nicht richtig machen, dass bei der dann nix ankommt und ich gezwungen bin eine Mailaddy von einem anderen Anbieter zu nehmen, da dieser dann gewisse Standarts erfüllt. | ||
![]() |
mabox |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hallo hab das hier grade gefunden.......auch wenn meine Antwort sehr spät kommt.
Bei mit kommt da immer ein Runtime Error: "Stream does not exist" dort wo das erste mal "ReadLine(com2)" vorkommt. wenn ich das richtig versteh stimmt da was mit der Serveradresse nicht. Ich hab mir jetzt extra ein GMX konto erstellt aber das hat auch nichts gebracht. |
||
Fujitsu-Siemens Laptop, 2Ghz Intel Core2Duo Prozessor, 2GB Ram, 120GB Festplatte, ATI Mobility Radeon X1400, Windows Vista Ultimate
www.mausoft.de.tl Dönerfresser Homepage |
![]() |
Tankbuster |
![]() Antworten mit Zitat ![]() |
---|---|---|
Code: [AUSKLAPPEN] com2 = OpenTCPStream(server$,25)
Hast du da auch den "server$" angegeben? [PS:] Oh der Thread ist ja schon alt ^^ |
||
Twitter
Download Jewel Snake! Windows|Android |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group