1. Yuko Tanaka
  2. PowerBuilder
  3. Friday, 19 May 2023 18:16 PM UTC

Hi,

I have the following codes that I based from the sample given in Appeon side. I'm using PowerBuilder 2022 R2 Beta. My IT department said that we can send email through our SMTP server without authentication, and leave Password, SecureProtocol, EnableTLS blank. When I try to send using send(), I get return code of -4 or -15. 

1. Are Password, secureProtocol, EnableTLS required even when our SMTP server doesn't require authentication? If so, what values should I use for SMTP that doesn't require authentication?

2. Is there a list of error code and how to solve it where I can refer to to resolve issues that I encounter?

Thank you.

Yuko

 

====

 

integer li_rc


// Create SmtpCLient
SmtpClient lsc_mail
lsc_mail = create SmtpClient

// Set Email Server Info
lsc_mail.Host = 'oursmtpserver.com'
lsc_mail.Port = 99
lsc_mail.Username = 'powerbuilder2022beta@oursmtpserver.com'
//lsc_mail.Password = ''
//lsc_mail.secureProtocol = 0 // All secure protocols
//lsc_mail.EnableTLS = True

// Set Sender, Recipient
lsc_mail.message.SetSender('powerbuilder2022beta@oursmtpserver.com', 'sender')
lsc_mail.message.AddRecipient('me@oursmtpserver.com', 'testername')

// Set Subject, HTMLBody and Resource Link
lsc_mail.message.Subject = 'PowerBuilder 2022 Beta email test'
lsc_mail.message.HTMLbody = '<html><body><p><b>Test Mail.</b></p><br /></body></html>'

// Send it
li_rc = lsc_mail.Send()
//li_rc = lsc_mail.SendAsync() // Send email asynchronously using this function

messagebox('li_rc', li_rc)

// Reset and Destroy
lsc_mail.Message.Reset()
Destroy lsc_mail

Tomas Beran Accepted Answer Pending Moderation
  1. Monday, 28 August 2023 14:48 PM UTC
  2. PowerBuilder
  3. # 1

Hi,

have you found an answer to your question #1?

I've a server to which I mustn't authenticate but without username/pass set in SMTPClient object I'm getting -15 (Incorrect username or password.) and no log file is created.

Comment
There are no comments made yet.
Yuko Tanaka Accepted Answer Pending Moderation
  1. Friday, 19 May 2023 22:10 PM UTC
  2. PowerBuilder
  3. # 2

Thank you Chris for very prompt response as always. This link is so helpful!! :)

Comment
  1. Chris Pollach @Appeon
  2. Saturday, 20 May 2023 03:18 AM UTC
Hi Yuko ... You are most welcome! ;-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 19 May 2023 19:13 PM UTC
  2. PowerBuilder
  3. # 3
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.