Send email
Posted: Wed Dec 02, 2020 6:34 pm
Cheers,
I have used the express library, also xBase ++, to send emails, but I don't understand why they are not sent. On the screen, it shows something that has to do with authentication. I really don't understand. Please help me. Attachment, source program, and a jpg file with the result of the execution
FUNCTION EMAILNEW()
LOCAL oLog := LogWriter():new()
// Connect to the Windows Live SMTP server. Port number
// 587 implies a secure SSL connection. Use standard
// port 25 for unencrypted communication and for
// servers which do not support SSL.
//
//
//LOCAL oSmtp := SMTPClient():new( "smtp.live.com", 587,, oLog, 2)
LOCAL oSmtp := SMTPClient():new( "smtp-mail.outlook.com", 587,, oLog, 2)
LOCAL oSender := MailAddress():new( "megapro@hotmail.es" )
LOCAL oRecipient := MailAddress():new( "megapro@hotmail.es" )
LOCAL oMail := MIMEMessage():new()
LOCAL cText
cText := "Happy Birthday to Jane" + CRLF + CRLF
cText += "Cheers" + CRLF
cText += " Roseus" + CRLF
oMail:setFrom ( oSender )
oMail:setSubject ( "Greetings" )
oMail:setMessage ( cText )
oMail:addRecipient( oRecipient )
IF oSmtp:connect( "zeusgroupinc@hotmail.com", "EXTWIN360")
IF oSmtp:send( oMail )
? "Message sent"
ELSE
? "Unable to deliver message"
ENDIF
oSmtp:disconnect()
//
ELSE
? "Unable to connect to mail server"
ENDIF
RETURN .T.
I have used the express library, also xBase ++, to send emails, but I don't understand why they are not sent. On the screen, it shows something that has to do with authentication. I really don't understand. Please help me. Attachment, source program, and a jpg file with the result of the execution
FUNCTION EMAILNEW()
LOCAL oLog := LogWriter():new()
// Connect to the Windows Live SMTP server. Port number
// 587 implies a secure SSL connection. Use standard
// port 25 for unencrypted communication and for
// servers which do not support SSL.
//
//
//LOCAL oSmtp := SMTPClient():new( "smtp.live.com", 587,, oLog, 2)
LOCAL oSmtp := SMTPClient():new( "smtp-mail.outlook.com", 587,, oLog, 2)
LOCAL oSender := MailAddress():new( "megapro@hotmail.es" )
LOCAL oRecipient := MailAddress():new( "megapro@hotmail.es" )
LOCAL oMail := MIMEMessage():new()
LOCAL cText
cText := "Happy Birthday to Jane" + CRLF + CRLF
cText += "Cheers" + CRLF
cText += " Roseus" + CRLF
oMail:setFrom ( oSender )
oMail:setSubject ( "Greetings" )
oMail:setMessage ( cText )
oMail:addRecipient( oRecipient )
IF oSmtp:connect( "zeusgroupinc@hotmail.com", "EXTWIN360")
IF oSmtp:send( oMail )
? "Message sent"
ELSE
? "Unable to deliver message"
ENDIF
oSmtp:disconnect()
//
ELSE
? "Unable to connect to mail server"
ENDIF
RETURN .T.