Lotusscript (Web) E-mail agent Sent To 3 Recipients

Hi there

Bit stuck (as usual). Below code works fine when one checkbox is ticked to receive by email or when the other checkbox is ticked to receive literature through post. But would like an additional option that will send to both “emails@mycompany.com” & “postouts@mycompany.com” when BOTH checkboxes are ticked (i.e. checkpost & checkmail). Can’t seem to get it to work properly for all three scenarios.

SCENARIO 1: When “checkemail” = “By email” sendto = “emails@mycompany.com

SCENARIO 2: When “checkpost” = “By Post” sendto = “postouts@mycompany.com

Need to get scenario 3 to work too:

SCENARIO 3: When “checkpost” = “By Post” AND “checkemail” = “By email” then sendtos = emails@mycompany.com" AND “postouts@mycompany.com

Current code snippet…

(Works fine for scenarios 1 & 2)

Dim recipients (0 To 0) As String

'Set up the recipients

If ((parameters(“checkemail”) = “By email”) + (parameters(“checkpost”)=“”)) Then

recipients(0) = “emails@mycompany.com

End If

If ((parameters(“checkpost”) = “By Post”) + (parameters(“checkemail”)=“”)) Then

recipients(0) = “postouts@mycompany.com

End If

'recipients(0) = parameters(“sendto”)

memo.Recipients=recipients

memo.SendTo=recipients

Subject: Lotusscript (Web) E-mail agent Sent To 3 Recipients

Dim recipients

recipients = ""



 'Set up the recipients 

If parameters("checkemail") = "By email" Then

	recipients = recipients & {,emails@mycompany.com}

End If



If parameters("checkpost") = "By Post" Then

	recipients = recipients & {,postouts@mycompany.com}

End If



'no recipients

if recipients = "" then exit sub



recipients = Fulltrim(Split(recipients, {,}))

memo.ReplaceItemValue {SendTo}, recipients

Subject: RE: Lotusscript (Web) E-mail agent Sent To 3 Recipients

Hi there

Many thanks for your reply.

Have tried what you suggested but it wouldn’t work. I think Split is an R6 thing - & our web servers are R5.

Any other suggestions of ways round this would be enormously appreciated…

Rgds

Subject: RE: Lotusscript (Web) E-mail agent Sent To 3 Recipients

don’t mean to be rude but i’d suggest you point in the R5 forum next time. if you’re going to continue to post in here and expect R5 code you should mention that it’s for R5 (you sleected 6.5.5 as your version?).

Dim recipients

recipients = ""



 'Set up the recipients 

If parameters("checkemail") = "By email" Then

	recipients = recipients & {,emails@mycompany.com}

End If



If parameters("checkpost") = "By Post" Then

	recipients = recipients & {,postouts@mycompany.com}

End If



'no recipients

If recipients = "" Then Exit Sub



memo.ReplaceItemValue {SendTo}, recipients

recipients = Evaluate({@trim(@explode(sendto, ","))}, memo)

memo.ReplaceItemValue {SendTo}, recipients