Android Question SMTP Error with HostEurope SMTP Server, Port 25 ... WORKS NOW !

Hubert Brandel

Active Member
Licensed User
Longtime User
Hi,
with the SSL and TLS I get an TimeOut Error:
B4X:
Try to send on: 587, SSL: false, TLS: true
TO: true count: 1 = hubert.brandel@gmx.de
After Send ...
SMTP send: false
java.net.SocketTimeoutException: Connection timed out
with 25 and both ssl and tls vars to false I get this
B4X:
java.lang.RuntimeException:
Empty writer returned: 503 Bad sequence of commands.
You must specify the recipients of a message before you can send it
so it looks like the DEBUGGER MODE could send the email, but the SMTP Server does not response on SSL / TSL ...
and the responce on port 25 is an error message from the server ... is this right ?
But what does he want to tell me with the bad sequence ?
B4X:
'Activity module
Sub Process_Globals
  ...
  Dim sDir As String = File.DirRootExternal  ' file attachement from ...
  Dim sFile As String = "HB-PDF.pdf"  ' name ...
  Dim sTo As String = "TargetEmailAdress@xyz.de"
  ' email über SMTP Server ... hierfür braucht man eine Internetverbindung und Klaus sollte eine eMail-Sendeadresse auf seinem Server anlegen.
  Dim SMTP As SMTP
  Dim sServer As String = "mail.server.de"  ' the SMTP Server
  Dim sSender As String = "ProgName@MySite.de" ' each app has its own eMailAdress to send from ...
  Dim sFrom As String = sSender
  Dim sPW As String = "..." ' the right password
  Dim iPort As Int  = I want to change this later in the APP
End Sub
' normaly this code should be here ...
Sub Activity_Create(FirstTime As Boolean)  
  If FirstTime Then
  Label1.Text = "eMail an: " & sTo
  Port25.Checked = True
  iPort = 25
  SMTP.Initialize(sServer, iPort, sFrom,sPW,"SMTP")
  SMTP.StartTLSMode = False
  SMTP.UseSSL = False
  End If   
End Sub
but than I can't change the port later in the app, am I right ?
so I removed the init from activity_create to the button_click event ...
B4X:
Sub Send_Click
  If File.Exists(sDir,sFile) Then ' no file, no eMail
  ToastMessageShow("PDF senden (" & iPort & ")...",False) ' this shows the right port
  SMTP.Initialize(sServer, iPort, sFrom, sPW, "SMTP" ) ' look good in debugger
  If iPort = 25 Then
  SMTP.UseSSL = False
  SMTP.StartTLSMode = False
  Else
  If iPort = 465 Then
  SMTP.UseSSL = True
  SMTP.StartTLSMode = False
  End If  
  If iPort = 587 Then
  SMTP.UseSSL = False
  SMTP.StartTLSMode = True
  End If  
  End If  
  Log("Try to send on: " & iPort & ", SSL: " & SMTP.UseSSL & ", TLS: " & SMTP.StartTLSMode )
   
  SMTP.Sender = sSender ' no change if I remove this line
  SMTP.To.Add(sTo)
  Log("TO: " & SMTP.To.IsInitialized & " count: " & SMTP.To.Size & " = " & SMTP.To.Get(0) ) ' The log say, that I have 1 TO adress and it is right.
  SMTP.Subject = "Test eMail mit PDF Anhang"
  SMTP.Body = "Diese PDF habe ich gerade vom Smartphone erzeugt ;-) "
  SMTP.AddAttachment(sDir,sFile)
  SMTP.Send
  Log("After Send ...")   
  Else
  ToastMessageShow("PDF fehlt !",False)
  End If
End Sub
Sub SMTP_MessageSent(Success As Boolean)
  Log("SMTP send: " & Success )
  If Success Then
  ToastMessageShow("PDF wurde versandt !",True)
  Else
  ToastMessageShow("eMail Fehler !",True)
  Log(LastException.Message)
  End If  
End Sub
the log says this with 25 (no SSL/TLS)
B4X:
...Try to send on: 25, SSL: false, TLS: false
TO: true count: 1 = hubert.brandel@gmx.de
After Send ...
SMTP send: false
java.lang.RuntimeException: Empty writer returned:
503 Bad sequence of commands. You must specify the recipients of a message before you can send it
I have cut & paste the code from some examples and could not find what is missing ;-(

the same result if I put the init inside of CREATE

PS: NET 1.50 ... just loaded into the ExtraLib SubDir.


PPS:

very strange, if I use my own GMX.DE email account with ...
iPort = 465
SMTP.UseSSL = True
SMTP.StartTLSMode = False

than the eMail is send correct and true will come back.
With ...
iPort = 587
SMTP.UseSSL = False
SMTP.StartTLSMode = True

same error 503 ...

I found a SMTP Error PDF with this info:

503 now means that your server request a authentication ... but still use 25.

Is there a setting to tell SMTP-Lib to authenticate ?


It will always try to authenticate. Are you sure that the server expects an SSL connection?
This server (with the 503 message and 25 as port) does NOT want a SSL connection, because normaly I use a Win32 bit EXE as CGI-EXE and send with the "ASINET" LIB from my win32 bit compiler. This LIB does not support SSL or TLS, just login with name and password. Its a hosteurope web server.
B4X:
*----------------------------------------------------------------------------------------
Function SendAsinet(aEmpfaenger,cBetreff,cText,cProgPfad,aAttachFile,cAntwortAdresse) ' my function
  ...
  LOCAL oSmtp  := SMTPClient():new( GetSmtpServer(),,, oLog, 2 )
  LOCAL oSender  := MailAddress():new( "xxxxx@yyyy.de" )
  LOCAL oMail  := MIMEMessage():new()
  oMail:setFrom  ( oSender  ) // "xxxxx@yyyy.de"
  oMail:setSubject  ( cBetreff  ) // "Test eMail ..."
  oMail:setMessage  ( cText  ) // just the body text
  aeval(aEmpfaenger, {|cEmp| oMail:addRecipient(MailAddress():new(cEmp) ) }) ' adds all TO adresses
  oMail:addHeader( "Date", TimeStampSMTP() ) ' need to correct an error with date
  if ! aAttachFile = NIL
  aeval(aAttachFile, {|cFile| oMail:attachFile( cFile ) })
  endif
  IF oSmtp:connect( sUserName, sPassword ) ' fix from a ini file
  IF oSmtp:send( oMail )
  lOK := .t.
  ? "Message sent"
  ELSE
  ? "Unable to deliver message"
  ENDIF
  oSmtp:disconnect()
  ELSE
  ? "Unable to connect to mail server"
  ENDIF
RETURN lOK
this LIB just connect with (sUserName, sPassword), no PORT (means standard), no SSL / TLS ... in both cases this server does not responde on SSL / TLS connections, but give this 503 Error back with 25 (try) connection.


Is it possible to see the communication between both ?
 

billzhan

Active Member
Licensed User
Longtime User
I didn't have used this smtp server, but I have try the net lib with 3 of main free smtp servers here in China(can't get server log),with all possible settings, they all threw errors:503 Bad sequence of commands. While I can send e-mails with Gmail.

See this post : Link and Link

So I suggest you try gmail first, to see if it the compatability issue.
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
Hi,

I found in the FAQ a link to a software for insert the AUTH info, maybe this can help you to see what the want:

>> http://netwinsite.com/dmail/smtpauth.htm

B4X:
Example of What SmtpAuth does
The following are 2 examples of what a client might say and receive from SmtpAuth, together with what SmtpAuth actually sends on to the server. After the authentication has taken place, SmtpAuth simply forwards whatever the client and server say on to each other. SmtpAuth will hold off from responding to the initial helo, or ehlo command until it has received confirmation from the server that the authentication was successful.

Client to SmtpAuth Data, Example 1:
220 matt.netwin.co.nz DSMTP ESMTP Mail Server
helo matt
250 matt.netwin.co.nz. Hello matt (127.0.0.1)
.
.
.

Client to SmtpAuth Data, Example 2:
220 matt.netwin.co.nz DSMTP ESMTP Mail Server
ehlo matt
250-matt.netwin.co.nz. Hello matt (127.0.0.1)
250-ETRN
250-DSN
250 HELP
.
.
.

Here is what SmtpAuth would say and receive from the server for either of the above cases:
220 matt.netwin.co.nz DSMTP ESMTP Mail Server
ehlo matt
250-matt.netwin.co.nz. Hello matt (127.0.0.1)
250-ETRN
250-DSN
250-AUTH PLAIN LOGIN
250 HELP
auth PLAIN AHRlc3QxAHRlc3Q=
235 Authentication succeeded

and here is the LOG file from my CGI.EXE that ASINET write while sending (maybe this helps more), real names are changed :

B4X:
Setze Datum und Zeit, TimeStampSMTP() =  Fri, 28 Feb 2014 15:00:15 +0100  :  NIL
Info: Socket created successfully
Info: Successfully connected to mail.MyWebSite.eu
Info: Server response: 220 RS205180.home ESMTP MailEnable Service, Version: 6.0-- ready at 02/28/14 15:00:19

Info: Sending: EHLO nowhere.com

Info: Server response: 250-home [89.204.138.144], this server offers 4 extensions
250-AUTH LOGIN
250-SIZE 5120000
250-HELP
250 AUTH=LOGIN

Info: Sending: AUTH LOGIN

Info: Server response: 334 VXNlcm5hbWU6

Info: Sending: SEtLb3N0SUBoa2Fici5ldQ==

Info: Server response: 334 UGFzc3dvcmQ6

Info: Sending: WGJhc2VPSw==

Info: Server response: 235 Authenticated

Info: Sending: MAIL FROM: <MyApp@MyWebSite.eu>

Info: Server response: 250 Requested mail action okay, completed

Info: Sending: RCPT TO: <xyz@gmx.de>

Info: Server response: 250 Requested mail action okay, completed

Info: Sending: RCPT TO: <xyz@web.de>

Info: Server response: 250 Requested mail action okay, completed

Info: Sending: DATA

Info: Server response: 354 Start mail input; end with <CRLF>.<CRLF>

Info: Sending Payload: From: MyApp <MyApp@MyWebSite.eu>
Subject: Test eMail from MyApp
Info: Server response: 250 Requested mail action okay, completed

Message sent
Info: Sending: QUIT
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
Can you post a link to their SMTP documentation (which ports and protocols are used)?
I only get the german FAQ page, even if i start over the english side ... :(
but it looks like that they do serve more than I thought:
http://faq.hosteurope.de/index.php?cpid=18652&in_object=2&searchword=smtp
http://faq.hosteurope.de/index.php?cpid=3472&in_object=2

I don't know how to get the log from the server. In the CGI app, I get the log info direct from the ASINET lib.
It would be nice to have a SMTP.LOGINFO as list or text ;-)
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
I found, that all servers accept a port 25 to login with my windows test program.
I show here the PowerBasic Code, not to hard to read and the logfile after, nothing spezial.
It would be nice if you Erel could debug the answers with your NET lib too. If you want to, I can eMail you the User, PW and SMTP Server name.
But not here, because we don't want too many testers ;-)

don't care about some inline assembler in the Mime function, the work is going on in SendMailA() and SUB Authentication().
I will post the LOG file in a new post.

B4X:
#COMPILE EXE
#DIM ALL
#INCLUDE ONCE "Win32API.inc"

' here are these defines with real values:
#INCLUDE ONCE "MyUsers.inc" ' secret ;-)

'$To  = ""
'
'$gmxUser  = ""
'$gmxPW  = ""
'$gmxServer  = "mail.gmx.net"
'%gmxPort  = 587 ' ??? 465 not with this code ' SSL ???
'
'$webDeUser  = ""
'$webDePW  = ""
'$webDeServer  = "smtp.web.de"
'%webDePort  = 587 ' STARTTLS
'
'$User  = ""
'$PW  = ""
'$Server  = ""  ' mailout.YourDomain.xyz
'%Port  = 25 ' SSL / STARTTLS ?


' my test text
$Subject  = "Test eMail äöü ß"
$Message  = "Test eMail äöü ß @ € "



GLOBAL nPort AS LONG

FUNCTION PBMAIN () AS LONG
  LOCAL sFrom AS STRING
  CLS

  DebugPrint( "Start SMTP-Server Test" )
  ? MessageId
  ? MessageId
  ? MessageId
  ?

  nPort = 25 ' this works on all the Servers here !

  ? "Test eMail GMX account: Server",$gmxServer
DebugPrint( "Test eMail GMX account:  " & $gmxServer )
  sFrom = $gmxUser
  nPort = %gmxPort ' if we want secure login ?
  ? SendMailA ( $gmxServer, $To, sFrom, $Subject+" GMX", $Message, $gmxUser ,$gmxPW )
DebugPrint( "" )
  ?
  ? "Test eMail WEB.DE account: Server",$webDeServer
DebugPrint( "Test eMail WEB.DE account:  " & $webDeServer )
  sFrom = $webDeUser
  nPort = %webDePort ' if we want secure login ?
  ? SendMailA ( $webDeServer, $To, sFrom, $Subject+" WEB.DE", $Message, $webDeUser, $webDePW )
DebugPrint( "" )
  ?
  ? "Test eMail HostEurope account: Server",$Server
DebugPrint( "Test eMail HostEurope account: " & $Server )
  sFrom = $User
  nPort = %Port ' NO secure login !
  ? SendMailA ( $Server, $To, sFrom, $Subject+" HostEurope" , $Message, $User ,$PW )
DebugPrint( "" )
  ?
  ? "Ende"

  WAITKEY$


END FUNCTION

' Login without SMTP Authentication - is not needed
' Send mail without SMTP Authentication
' SendMail(MailHost, MailTo, MailFrom, Subject, Message)
' Send mail with SMTP Authentication
' ret = SendMailA(MailHost, MailTo, MailFrom, Subject, Message, USER, Password)

MACRO MessageId () = REMOVE$(GUIDTXT$(GUID$), ANY "{-}") + "@pbcgi"

MACRO MailMan (sSend, nExpectedResult)
  IF LEN(sSend) THEN TCP PRINT nTCP, sSend
  TCP LINE nTCP, sReply
DebugPrint( "MailMan (sSend, nExpectedResult) : (" & sSend & "," & STR$(nExpectedResult) & ")"  )
DebugPrint( "  sReply: '" & sReply & "'" )
  IF VAL(sReply) <> nExpectedResult THEN
  TCP CLOSE nTCP
  FUNCTION = "Expected " + FORMAT$(nExpectedResult) _
  + " in response to " + sSend + $CRLF _
  + "But got " + $CRLF + sReply
  EXIT FUNCTION
  END IF
END MACRO

FUNCTION SendMailA (BYVAL sMailHost AS STRING, _
  BYVAL sMailTo  AS STRING, _
  BYVAL sMailFrom AS STRING, _
  BYVAL sSubject  AS STRING, _
  BYVAL sMessage  AS STRING, _
  BYVAL sUser  AS STRING, _
  BYVAL sPassword AS STRING, _
  OPTIONAL BYVAL sLocalHost AS STRING _
  ) AS STRING

  LOCAL indx  AS LONG
  LOCAL nTCP  AS LONG
  LOCAL nHost  AS LONG
  LOCAL sReply AS STRING

  LOCAL e AS LONG

  IF LEN(sLocalHost) = 0 THEN
  sLocalHost = sMailHost
  END IF

DebugPrint( FUNCNAME$ + " Start" )

  nTCP = FREEFILE
DebugPrint( FUNCNAME$ + " TCP OPEN "+$DQ+"smtp"+$DQ+" ... works"  )
DebugPrint( FUNCNAME$ + " TCP OPEN PORT nPort ... works too, nPort: "+STR$(nPort)  )
'  TCP OPEN "smtp" AT sMailHost AS nTCP ' open the SERVICE SMTP ...
  TCP OPEN PORT nPort AT sMailHost AS nTCP ' or with the PORT: sPort
  IF ERR THEN
  FUNCTION = "Can't connect to mail host " + sMailHost + $CRLF + ERROR$
  EXIT FUNCTION
  END IF
  MailMan("", 220)

  'MailMan("EHLO " + sMailHost, 250)
  TCP PRINT nTCP, "EHLO " & sMailHost

  DO WHILE NOT EOF(nTCP)
  TCP LINE nTCP, sReply
  e = VAL(LEFT$(sReply, 3))
  LOOP

  IF e <> 250 THEN
DebugPrint( FUNCNAME$ + " no reply" )
  FUNCTION = "no reply"
  EXIT FUNCTION
  END IF

  Authentication nTCP, VAL(sReply), sUser, sPassword

  indx = INSTR(sMailFrom, "<")
  IF indx THEN
  MailMan("MAIL FROM:" + MID$(sMailFrom,indx), 250)
  ELSE
  MailMan("MAIL FROM:<" + sMailFrom + ">", 250)
  END IF

  indx = INSTR(sMailTo, "<")
  IF indx THEN
  MailMan("RCPT TO:" + MID$(sMailTo,indx), 250)
  ELSE
  MailMan("RCPT TO:<" + sMailTo + ">", 250)
  END IF

  MailMan("DATA", 354)

  IF INSTR(sMailFrom, "<") THEN
  TCP PRINT nTCP, "From: " + sMailFrom
  ELSE
  TCP PRINT nTCP, "From: <" + sMailFrom + ">"
  END IF
  IF INSTR(sMailTo, "<") THEN
  TCP PRINT nTCP, "To: " + sMailTo
  ELSE
  TCP PRINT nTCP, "To: <" + sMailTo + ">"
  END IF
  TCP PRINT nTCP, "Date: " + MailDate
  TCP PRINT nTCP, "Message-Id: <" + MessageId + ">"

  IF INSTR(sMessage, "Message-Boundary-8775") THEN
  TCP PRINT nTCP, "MIME-Version: 1.0"
  TCP PRINT nTCP, "Content-type: Multipart/Mixed; boundary=Message-Boundary-8775"
  END IF
  TCP PRINT nTCP, "Subject: " + sSubject
  TCP PRINT nTCP, "X-Mailer: PowerBASIC Mailer 3.0"
  TCP PRINT nTCP, ""

  sMessage = $CRLF + sMessage
  REPLACE $CRLF + "." WITH $CRLF + ".." IN sMessage
  TCP PRINT nTCP, MID$(sMessage, 3)

  MailMan(".", 250)

  MailMan("QUIT", 221)

  TCP CLOSE nTCP

DebugPrint( FUNCNAME$ + " Ende" )

END FUNCTION

FUNCTION MailDate () AS STRING

  LOCAL szFormat  AS ASCIIZ * 40
  LOCAL szTemp  AS ASCIIZ * 40
  LOCAL sResult  AS STRING
  LOCAL t  AS SYSTEMTIME
  LOCAL sUCTOffset AS STRING
  LOCAL tzi  AS TIME_ZONE_INFORMATION

  GetLocalTime t

  szFormat = "ddd',' dd MMM yyyy"
  GetDateFormat %LOCALE_USER_DEFAULT, 0, t, szFormat, szTemp, SIZEOF(szTemp)
  sResult = szTemp

  szFormat = "HH':'mm':'ss"
  GetTimeFormat %LOCALE_USER_DEFAULT, 0, t, szFormat, szTemp, SIZEOF(szTemp)

  SELECT CASE GetTimeZoneInformation(tzi)

  CASE %TIME_ZONE_ID_DAYLIGHT
  sUCTOffset = IIF$((tzi.bias + tzi.DaylightBias) <= 0, "+", "-") _
  + FORMAT$((tzi.bias + tzi.DaylightBias) \ 60, "00") _
  + FORMAT$((tzi.bias + tzi.DaylightBias) MOD 60, "00")

  CASE %TIME_ZONE_ID_STANDARD
  sUCTOffset = IIF$((tzi.bias + tzi.StandardBias) <= 0, "+", "-") _
  + FORMAT$((tzi.bias + tzi.StandardBias) \ 60, "00") _
  + FORMAT$((tzi.bias + tzi.StandardBias) MOD 60, "00")

  CASE ELSE
  sUCTOffset = "-0000"

  END SELECT

  FUNCTION = sResult + " " + szTemp + " " + sUCTOffset

END FUNCTION

SUB Authentication(BYVAL hTCP AS LONG, e AS LONG, secUser AS STRING, secPassword AS STRING)
  DIM mTmp AS STRING
  DIM Buffer AS STRING

DebugPrint( FUNCNAME$ + " Start" )

  DO WHILE NOT EOF(hTCP)
  TCP LINE hTCP, Buffer
  e = VAL(LEFT$(Buffer, 3))
  LOOP
DebugPrint( FUNCNAME$ + " read pending reply: '" & Buffer & "'")
DebugPrint( FUNCNAME$ + " send: AUTH LOGIN")
  TCP PRINT hTCP, "AUTH LOGIN"
  DO WHILE NOT EOF(hTCP)
  TCP LINE hTCP, Buffer
  e = VAL(LEFT$(Buffer, 3))
  LOOP
DebugPrint( FUNCNAME$ + " read AUTH reply: '" & Buffer & "'")
  IF e = 334 THEN
  mTmp = StringToMime(secUser)
DebugPrint( FUNCNAME$ + " send StringToMime(secUser): " & mTmp )
  TCP PRINT hTCP, mTmp
  DO WHILE NOT EOF(hTCP)
  TCP LINE hTCP, Buffer
  e = VAL(LEFT$(Buffer, 3))
  LOOP
DebugPrint( FUNCNAME$ + " read USER reply: '" & Buffer & "'")
  IF e = 334 THEN
  mTmp = StringToMime(secPassword)
DebugPrint( FUNCNAME$ + " send StringToMime(secPassword): " & mTmp )
  TCP PRINT hTCP, mTmp
  DO WHILE NOT EOF(hTCP)
  TCP LINE hTCP, Buffer
  e = VAL(LEFT$(Buffer, 3))
  LOOP
DebugPrint( FUNCNAME$ + " read PW reply: '" & Buffer & "'")
  END IF
  END IF
END SUB

FUNCTION StringToMIME(BYVAL InBuff AS STRING) AS STRING
  LOCAL Enc  AS STRING * 64
  LOCAL b  AS ASCIIZ * 4
  LOCAL OutBuff AS STRING
  REGISTER i  AS LONG

  Enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
  WHILE LEN(InBuff)
  b = LEFT$(InBuff, 3)
  ! mov AL, b[0]
  ! shr AL, 2
  ! movzx i, AL
  OutBuff = OutBuff + MID$(Enc, i + 1, 1)
  ! mov AL, b[1]
  ! mov AH, b[0]
  ! shr AX, 4
  ! and AL, &H3F
  ! movzx i, AL
  OutBuff = OutBuff + MID$(Enc, i + 1, 1)
  IF LEN(InBuff) = 1 THEN
  OutBuff = OutBuff + "=="
  EXIT DO
  END IF
  ! mov AL, b[2]
  ! mov AH, b[1]
  ! shr AX, 6
  ! and AL, &H3F
  ! movzx i, AL
  OutBuff = OutBuff + MID$(Enc, i + 1, 1)
  IF LEN(InBuff) = 2 THEN
  OutBuff = OutBuff + "="
  EXIT DO
  END IF
  ! mov AL, b[2]
  ! and AL, &H3F
  ! movzx i, AL
  OutBuff = OutBuff + MID$(Enc, i + 1, 1)
  InBuff = MID$(InBuff, 4)
  WEND
  FUNCTION = OutBuff
END FUNCTION

SUB DebugPrint( sTxt AS STRING )
  STATIC nLog AS LONG
  LOCAL sName AS STRING
  IF nLog = 0 THEN ' open it
  nLog = FREEFILE
  sName = EXE.PATH$ + EXE.NAME$ + "_LOG.txt"
  OPEN sName FOR OUTPUT AS nLog
  END IF
  PRINT # nLog, TIME$, sTxt
END SUB
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
Ok, here is the LOG file created with DebugPrint() lines.
B4X:
21:57:55      Start SMTP-Server Test
21:57:55      Test eMail GMX account:        mail.gmx.net
21:57:55      SENDMAILA Start
21:57:55      SENDMAILA TCP OPEN "smtp" ... works
21:57:55      SENDMAILA TCP OPEN PORT nPort ... works too, nPort:  587
21:57:55      MailMan (sSend, nExpectedResult) : (, 220)
21:57:55              sReply: '220 gmx.com (mrgmx103) Nemesis ESMTP Service ready'
21:57:55      AUTHENTICATION Start
21:57:55      AUTHENTICATION read pending reply: ''
21:57:55      AUTHENTICATION send: AUTH LOGIN
21:57:55      AUTHENTICATION read AUTH reply: '334 VXNlcm5hbWU6'
21:57:55      AUTHENTICATION send StringToMime(secUser): SHViZXJ0LkJyYW5kZWxAZ214LmRl
21:57:55      AUTHENTICATION read USER reply: '334 UGFzc3dvcmQ6'
21:57:55      AUTHENTICATION send StringToMime(secPassword): MyRFbGsuSHViJDM=
21:57:55      AUTHENTICATION read PW reply: '235 Authentication succeeded'
21:57:55      MailMan (sSend, nExpectedResult) : (MAIL FROM:<Hubert.Brandel@gmx.de>, 250)
21:57:55              sReply: '250 Requested mail action okay, completed'
21:57:55      MailMan (sSend, nExpectedResult) : (RCPT TO:<Hubert.Brandel@web.de>, 250)
21:57:55              sReply: '250 OK'
21:57:55      MailMan (sSend, nExpectedResult) : (DATA, 354)
21:57:55              sReply: '354 Start mail input; end with <CRLF>.<CRLF>'
21:57:55      MailMan (sSend, nExpectedResult) : (., 250)
21:57:55              sReply: '250 Requested mail action okay, completed: id=0LjJCt-1WxV1L2TXj-00dZ1H'
21:57:55      MailMan (sSend, nExpectedResult) : (QUIT, 221)
21:57:55              sReply: '221 gmx.com Service closing transmission channel'
21:57:55      SENDMAILA Ende
21:57:55     
21:57:55      Test eMail WEB.DE account:    smtp.web.de
21:57:55      SENDMAILA Start
21:57:55      SENDMAILA TCP OPEN "smtp" ... works
21:57:55      SENDMAILA TCP OPEN PORT nPort ... works too, nPort:  587
21:57:55      MailMan (sSend, nExpectedResult) : (, 220)
21:57:55              sReply: '220 web.de (mrweb002) Nemesis ESMTP Service ready'
21:57:55      AUTHENTICATION Start
21:57:55      AUTHENTICATION read pending reply: ''
21:57:55      AUTHENTICATION send: AUTH LOGIN
21:57:55      AUTHENTICATION read AUTH reply: '334 VXNlcm5hbWU6'
21:57:55      AUTHENTICATION send StringToMime(secUser): SHViZXJ0LkJyYW5kZWxAd2ViLmRl
21:57:56      AUTHENTICATION read USER reply: '334 UGFzc3dvcmQ6'
21:57:56      AUTHENTICATION send StringToMime(secPassword): JGVsay5odWIk
21:57:56      AUTHENTICATION read PW reply: '235 Authentication succeeded'
21:57:56      MailMan (sSend, nExpectedResult) : (MAIL FROM:<Hubert.Brandel@web.de>, 250)
21:57:56              sReply: '250 Requested mail action okay, completed'
21:57:56      MailMan (sSend, nExpectedResult) : (RCPT TO:<Hubert.Brandel@web.de>, 250)
21:57:56              sReply: '250 OK'
21:57:56      MailMan (sSend, nExpectedResult) : (DATA, 354)
21:57:56              sReply: '354 Start mail input; end with <CRLF>.<CRLF>'
21:57:56      MailMan (sSend, nExpectedResult) : (., 250)
21:57:56              sReply: '250 Requested mail action okay, completed: id=0M9oaG-1WGQNM43HU-00B54O'
21:57:56      MailMan (sSend, nExpectedResult) : (QUIT, 221)
21:57:56              sReply: '221 web.de Service closing transmission channel'
21:57:56      SENDMAILA Ende
21:57:56     
21:57:56      Test eMail HostEurope account: hkabr.eu
21:57:56      SENDMAILA Start
21:57:56      SENDMAILA TCP OPEN "smtp" ... works
21:57:56      SENDMAILA TCP OPEN PORT nPort ... works too, nPort:  25
21:57:56      MailMan (sSend, nExpectedResult) : (, 220)
21:57:56              sReply: '220 RS205180.home ESMTP MailEnable Service, Version: 6.0-- ready at 03/22/14 21:57:59'
21:57:56      AUTHENTICATION Start
21:57:56      AUTHENTICATION read pending reply: ''
21:57:56      AUTHENTICATION send: AUTH LOGIN
21:57:56      AUTHENTICATION read AUTH reply: '334 VXNlcm5hbWU6'
21:57:56      AUTHENTICATION send StringToMime(secUser): QjRBLVRlc3RAaGthYnIuZXU=
21:57:56      AUTHENTICATION read USER reply: '334 UGFzc3dvcmQ6'
21:57:56      AUTHENTICATION send StringToMime(secPassword): QTEyMzQ1Njc4OU8=
21:57:56      AUTHENTICATION read PW reply: '235 Authenticated'
21:57:56      MailMan (sSend, nExpectedResult) : (MAIL FROM:<B4A-Test@hkabr.eu>, 250)
21:57:56              sReply: '250 Requested mail action okay, completed'
21:57:56      MailMan (sSend, nExpectedResult) : (RCPT TO:<Hubert.Brandel@web.de>, 250)
21:57:56              sReply: '250 Requested mail action okay, completed'
21:57:56      MailMan (sSend, nExpectedResult) : (DATA, 354)
21:57:56              sReply: '354 Start mail input; end with <CRLF>.<CRLF>'
21:57:56      MailMan (sSend, nExpectedResult) : (., 250)
21:57:56              sReply: '250 Requested mail action okay, completed'
21:57:56      MailMan (sSend, nExpectedResult) : (QUIT, 221)
21:57:56              sReply: '221 Service closing transmission channel'
21:57:56      SENDMAILA Ende
21:57:56
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
Hosteurope mail server need this !

B4X:
SMTP.Initialize(sServer, iPort, sUser, sPW, "SMTP" )
SMTP.AuthMethod = SMTP.AUTH_LOGIN
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
and works even with SSL login, PERFEKT !

B4X:
iPort = 25
SMTP.Initialize(sServer, iPort, sUser, sPW, "SMTP" )
SMTP.AuthMethod = SMTP.AUTH_LOGIN ' wichtig für Hosteurope Server
SMTP.UseSSL = True
SMTP.StartTLSMode = False
 
Upvote 0
Top