- Mark Porter
- PowerBuilder
- Tuesday, 22 August 2023 08: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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.