1. Clarence Chamorro
  2. PowerBuilder
  3. Friday, 9 February 2024 23:03 PM UTC

Just a quick question. can I add multiple recipients in the AddRecipient of the native SmtpClient email. Like for example:

SMTPClient Lnv_SmtpClient

Lnv_SmtpClient = Create SMTPClient

Lnv_SmtpClient.Message.AddRecipient('testr002.appeon@gmail.com','tester002.me@gmail.com','domyquestion@gmail.com')

.

.

.

Lnv_SmtpClient.Send()

 

Question will it send it to the 3 emails? or will it give an error?  I have not try.

 

Regards,

 

Clarence.

Andreas Mykonios Accepted Answer Pending Moderation
  1. Monday, 12 February 2024 06:55 AM UTC
  2. PowerBuilder
  3. # 1

Hi.

The correct way to implement that is as follows:

integer li_ret

li_ret = Lnv_SmtpClient.Message.AddRecipient('testr002.appeon@gmail.com')
li_ret = Lnv_SmtpClient.Message.AddRecipient('tester002.me@gmail.com')
li_ret = Lnv_SmtpClient.Message.AddRecipient('domyquestion@gmail.com')

Normally you also need the return value for every call of addrecipient. Normally it should have a value > 0.

Andreas.

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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.