hb_SendMail() with lPopAuth
Posted: Fri Nov 22, 2019 1:32 am
hi,
when send with SMTP some Provider need lPopAuth which is Parameter Nr. 16
Parameter 12 is for POP3 Server where need to login to identify.
BUT there is only 1 x Port for SMTP (465/587) and POP3 have other Port than SMTP (995)
so how to handle this with hb_SendMail()
---
i found in "core-master" c:\harbour\contrib\hbtip\mailsend.prg
while i have Problem with Login i can't use this Syntax
i have to set User / Password after connect
this Way it work for me
POP3
SMTP
now i can send Email via SMTP/SSL
here Original MailSend.PRG. please modify it yourself and include parameter for Pop3 Server Port when using lPopAuth
have fun
when send with SMTP some Provider need lPopAuth which is Parameter Nr. 16
Parameter 12 is for POP3 Server where need to login to identify.
BUT there is only 1 x Port for SMTP (465/587) and POP3 have other Port than SMTP (995)
so how to handle this with hb_SendMail()
---
i found in "core-master" c:\harbour\contrib\hbtip\mailsend.prg
while i have Problem with Login i can't use this Syntax
Code: Select all
oUrl1 := TUrl():New( iif( lSSL, "pop3s://", "pop://" ) + cUser + ":" + cPass + "@" + cPopServer + "/" )
oUrl := TUrl():New( iif( lSSL, "smtps://", "smtp://" ) + cUser + iif( Empty( cSMTPPass ), "", ":" + cSMTPPass ) + "@" + cServer )
this Way it work for me
POP3
Code: Select all
IF lSSL
cUrl := "pops://"
ELSE
cUrl := "pop://"
ENDIF
// add Port for POP3
cUrl += cPopServer + ":" + LTRIM(STR(nPortPOP3))
oUrl1 := TUrl():New( cUrl )
oPop := TIPClientPOP():New( oUrl1, xTrace )
oPop:oUrl:cUserID := cUser
oPop:oUrl:cPassword := cPass
oPop:nConnTimeout := ntimeout
Code: Select all
IF lSSL
cUrl := "smtps://"
ELSE
cUrl := "smtp://"
ENDIF
// this is Port for SMTP
cUrl += cServer + ":" + LTRIM(STR(nPortSMTP))
oUrl := TUrl():New( cUrl )
oUrl:cUserID := cUser
oUrl:cPassword := cPass
oUrl:cFile := cTo + ;here Original MailSend.PRG. please modify it yourself and include parameter for Pop3 Server Port when using lPopAuth
have fun