1. Mark Porter
  2. PowerBuilder
  3. Tuesday, 22 August 2023 20:25 PM UTC

I'm trying to do a simple test using a gmail account.

Any ideas what the problem might be?

I get an Error - 14 when it runs.

Email password in this example is NOT valid for security.

 

Integer li_rc
SMTPClient lnv_SmtpClient

lnv_SmtpClient = CREATE SMTPClient

//Sets the email-sender information
lnv_SmtpClient.Host = "smtp.gmail.com"
lnv_SmtpClient.Port = 465
lnv_SmtpClient.Username = "robvoyager1066@gmail.com"
lnv_SmtpClient.password = "xxxxxxxx"
lnv_SmtpClient.EnableTLS = True


//Sets the email message
lnv_SmtpClient.Message.SetSender("robvoyager1066@gmail.com","robvoyager1066")
lnv_SmtpClient.Message.AddRecipient("acc@me.com")
lnv_SmtpClient.Message.Subject = "SMTPClient Test Message"
lnv_SmtpClient.Message.TextBody = "SMTPClient example message body"

//Sends the email
li_rc = lnv_SmtpClient.Send()

IF li_rc = 1 THEN
Messagebox('SMTPClient','Mail sent successfully')
ELSE
Messagebox('SMTPClient' ,'Email sending failed. Return ' + String(li_rc) + '.', StopSign!)
END IF

DESTROY lnv_SmtpClient

Who is viewing this page
Mark Goldsmith Accepted Answer Pending Moderation
  1. Thursday, 24 August 2023 13:26 PM UTC
  2. PowerBuilder
  3. # 1

Hi Mark,

I think the port you're using, 465, is reserved for SSL. Have you tried using port 587, which is for TLS?

HTH...regards,

Mark

Comment
There are no comments made yet.
Dan Cooperstock Accepted Answer Pending Moderation
  1. Thursday, 24 August 2023 02:11 AM UTC
  2. PowerBuilder
  3. # 2

Google has largely disabled SMTP access to emails. You have to use OAuth2 and their email API. (That's what we ended up doing in our applications that have to send emails, and use SMTP for everyone else.)

Comment
There are no comments made yet.
Mark Porter Accepted Answer Pending Moderation
  1. Wednesday, 23 August 2023 00:21 AM UTC
  2. PowerBuilder
  3. # 3

I did the setup necessary for google and it still didn't work.

 

Created an outlook account and that worked fine.

 

Thanks for all the ideas :-)

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 23 August 2023 00:12 AM UTC
  2. PowerBuilder
  3. # 4

Not too long ago, I used a gmail account for our BugGenie tool. I had all the settings correct in the gmail account and things were working.

Nowadays, there seems to be no way to get it to work. Google is really making it more and more difficult, so I'm now using my own smtp service.

Just my 2cts.

 

Comment
There are no comments made yet.
luis avilan Accepted Answer Pending Moderation
  1. Tuesday, 22 August 2023 23:30 PM UTC
  2. PowerBuilder
  3. # 5

Hello An app password is a 16-digit password that gives a less secure app or device permission to access your Google Account.These passwords can only be used with accounts that have two-step verification turned on.

 

Iniciar sesión con contraseñas de aplicación - Ayuda de Cuenta de Google

Best regards

Comment
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 22 August 2023 21:07 PM UTC
  2. PowerBuilder
  3. # 6

Hi Mark,

 

Did you enable your account for external application access? Please review this article for more details.

Basically, since this method of email sharing is very insecure you need to explicitly mark your account to allow this. Google will then give you a separate set of username/passwords to use for the SMTP client.

 

Regards,
Francisco

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.