Send email

This forum is for eXpress++ general support.
Post Reply
Message
Author
Diego Euri Almanzar
Posts: 155
Joined: Thu Nov 05, 2020 10:51 am
Location: DOMINICAN REPUBLIC

Send email

#1 Post by Diego Euri Almanzar »

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.
Attachments
ENVIO1.JPG
ENVIO1.JPG (92.45 KiB) Viewed 6190 times

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Send email

#2 Post by rdonnay »

Have you tried port 465?

Try this:

LOCAL oSmtp := SMTPClient():new( "tls://smtp-mail.outlook.com", 465,, oLog, 2)
The eXpress train is coming - and it has more cars.

Diego Euri Almanzar
Posts: 155
Joined: Thu Nov 05, 2020 10:51 am
Location: DOMINICAN REPUBLIC

Re: Send email

#3 Post by Diego Euri Almanzar »

HI

WITH THE SERVER NAME THAT DONNAY SENT ME, THE RESULT IS AS FOLLOWS:
THERE WAS NO CONNECTION WITH THE SERVER

WITH THE OTHER SERVERS I'VE TRIED, I THINK I'M CLOSE TO SUCCESSFUL ALTHOUGH THE FOLLOWING MESSAGE PERSISTS:

Info: Socket created successfully
Info: Successfully connected to smtp.gmail.com
Info: Server response: 220 smtp.gmail.com ESMTP y6sm2167045qkj.60 - gsmtp

Info: Sending: HELO nowhere.com

Info: Server response: 250 smtp.gmail.com at your service

Info: Sending: MAIL FROM: <megapro@hotamil.es>

Info: Server response: 530 5.7.0 Must issue a STARTTLS command first. y6sm2167045qkj.60 - gsmtp

Error: Unexpected response from server 5
Message transmission failed
Info: Sending: QUIT
**

DO YOU HAVE ANY IDEA OF THAT ERROR STOPPING THE SENDING OF THE EMAIL?

THANK YOU FOR THE HELP

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Send email

#4 Post by Auge_Ohr »

hi,
Diego Euri Almanzar wrote: Mon Dec 07, 2020 12:24 am Info: Server response: 530 5.7.0 Must issue a STARTTLS command first. y6sm2167045qkj.60 - gsmtp
as Roger say
Have you tried port 465?
some Provider use 465 instead of 587 even when "help" file say 587.
greetings by OHR
Jimmy

Diego Euri Almanzar
Posts: 155
Joined: Thu Nov 05, 2020 10:51 am
Location: DOMINICAN REPUBLIC

Re: Send email

#5 Post by Diego Euri Almanzar »

Roger, and Jimmy, thank you for your attention and help.

I was able to solve the problem of sending emails by buying the latest version of Alaska Xbase ++ 2.0

Apparently version 1.9 has problems sending email. I am very satisfied with version 2.0

Best regards

Post Reply