Max. length BCC field using SMTPMailService?

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
User avatar
Joop
Posts: 4
Joined: Tue Dec 01, 2015 2:38 am
Location: The Netherlans

Max. length BCC field using SMTPMailService?

Post by Joop » Thu Feb 06, 2020 12:18 am

Hi all,

I am using Lansa Integrator's SMTPMailService to send an e-mail to hundreds of recipients. I have made a working list where the e-mail adresses are stored. Then I've put all the e-mail addresses in the BCC field so that I only have to send one e-mail instead of hundreds of individual e-mails.

When I use this method from within a reusable part in a Windows application sometimes there is an error like 'invalid email address'. I'm sure all the selected e-mail addresses in the list are correct so that shouldn't be an issue here. It happens when I select a large amount of e-mail addresses at once. A smaller amount of email address are processed just fine.

I was wondering if there was a maximum length of data in a BCC field? So when those hundreds of email adresses get concatenated like: email1@domain.com;email2@domain.com;email3@domain.com etc. then when the maximum length is reached, the last e-mail address would be cut off resulting in the last e-mail address to be invalid.

I've taken some of the source code that I use below:

Code: Select all

Def_List Name(#WL_EMLADR) Fields(#BLEEMA) Type(*WORKING) Entrys(9999)
* Set sender (FROM:)
Case Of_Field(#USER)
* Klokteam users
When Value_Is('= GRTPPR' '= GRTPPIZ' '= GRTPAVG' '= GRTPEC' '= GRTAEC' '= GRTAPIZ' '= GRTAPR' '= GRTAAVG')
#GRBEML := *Z03_EML_KLOK
Otherwise
#GRBEML := *Z03_EML_ZON
Endcase
Use Builtin(TCONCAT) With_Args('SET FROM(' #GRBEML ')') To_Get(#JSMCMD)
Use Builtin(JSMX_COMMAND) With_Args(#JSMHDNL #JSMCMD) To_Get(#JSMSTS #JSMMSG)
Execute Subroutine(CHECK_JSM) With_Parms(#JSMSTS #JSMMSG)
* Set addressed (TO:)
Clr_List Named(#WL_EMLADR)
Change Field(#BLEEMA) To(*Z03_EML_KLOK)
Add_Entry To_List(#WL_EMLADR)
Use Builtin(JSMX_COMMAND) With_Args(#JSMHDNL 'SET TO(*LIST) SERVICE_LIST(BLEEMA)') To_Get(#JSMSTS #JSMMSG #WL_EMLADR)
Execute Subroutine(CHECK_JSM) With_Parms(#JSMSTS #JSMMSG)
* Send email to selected clients (as BCC)
Clr_List Named(#WL_EMLADR)
Selectlist Named(#LTVW_MAIL)
Continue If(#LTVW_MAIL.CurrentItem.Checked ^= True)
Change Field(#BLEEMA) To(#GRJEML)
Add_Entry To_List(#WL_EMLADR)
Endselect
* Set Blind Carbon Copy (BCC:)
Use Builtin(JSMX_COMMAND) With_Args(#JSMHDNL 'SET BCC(*LIST) SERVICE_LIST(BLEEMA)') To_Get(#JSMSTS #JSMMSG #WL_EMLADR)
Execute Subroutine(CHECK_JSM) With_Parms(#JSMSTS #JSMMSG)
* Set subject (RE:)
#EMLSUBJ := #STD_TEXTL
Use Builtin(TCONCAT) With_Args('SEND SUBJECT(' #EMLSUBJ ') SERVICE_LIST(AEAOPM)') To_Get(#JSMCMD)
Use Builtin(JSMX_COMMAND) With_Args(#JSMHDNL #JSMCMD) To_Get(#JSMSTS #JSMMSG #MEMO_BODY)
Execute Subroutine(CHECK_JSM) With_Parms(#JSMSTS #JSMMSG)
--
Regards,
Joop Roseboom

René Houba
Posts: 61
Joined: Thu Nov 26, 2015 7:03 am

Re: Max. length BCC field using SMTPMailService?

Post by René Houba » Thu Feb 06, 2020 6:35 am

Hi Joop,

What LANSA version is this?

Kind regards,
René

bark
Posts: 30
Joined: Thu Jan 05, 2017 9:56 am

Re: Max. length BCC field using SMTPMailService?

Post by bark » Thu Feb 06, 2020 11:49 am

Since a smaller list is OK, it would suggest a limit. Check the trace files generated by JSM to see if you can see a truncated/corrupted email address. If its always truncated on the same one, then it would suggest a limit. If you then remove that one address and all addresses after it and its OK, you will have found the limit.

User avatar
Joop
Posts: 4
Joined: Tue Dec 01, 2015 2:38 am
Location: The Netherlans

Re: Max. length BCC field using SMTPMailService?

Post by Joop » Tue Feb 18, 2020 9:14 pm

René Houba wrote:
Thu Feb 06, 2020 6:35 am
Hi Joop,

What LANSA version is this?

Kind regards,
René
Hi René,

Lansa V13.2 at the moment.

Regards,
Joop
--
Regards,
Joop Roseboom

User avatar
Joop
Posts: 4
Joined: Tue Dec 01, 2015 2:38 am
Location: The Netherlans

Re: Max. length BCC field using SMTPMailService?

Post by Joop » Tue Feb 18, 2020 9:17 pm

bark wrote:
Thu Feb 06, 2020 11:49 am
Since a smaller list is OK, it would suggest a limit. Check the trace files generated by JSM to see if you can see a truncated/corrupted email address. If its always truncated on the same one, then it would suggest a limit. If you then remove that one address and all addresses after it and its OK, you will have found the limit.
Ok, thanks!
Will try and see if that works.

Regards,
Joop
--
Regards,
Joop Roseboom

Post Reply