Re: Connect-IT - Setting multiple mail addresses (175 Views)
Reply
Occasional Advisor
Sutot
Posts: 19
Registered: ‎05-21-2012
Message 1 of 4 (214 Views)
Accepted Solution

Connect-IT - Setting multiple mail addresses

Hi experts,

 

I configured a scenario in connecti-it to send emails.

 

I have to read a list of email addresses from a text file (separated by ';' ) and send an email to them.

 

I could do this using a java or perl script, but the customer preferes to use Connect-IT.

 

But in Connect-It I don't know how to set a multiple address in "To" field of OutMailMessage. 

 

I'd need something like this:

 

Dim strToAddress As String

Dim arrayToAddress() As String

strToAddress="address1@mail.it;address2@mail.it;address3@mail.it"

arrayToAddress=Split(strToAddress,';')

RetVal=ArrayToAddress

 

But it doesn't work. Can someone help me?

 

Best regards,

Sutot

 

 

 

 

Please use plain text.
HP Expert
NgocNgo
Posts: 214
Registered: ‎06-30-2013
Message 2 of 4 (175 Views)

Re: Connect-IT - Setting multiple mail addresses

[ Edited ]

Hi,

 

Please take a look at the below information. It might help you:

Knowledge document information

Title: How to send email to several users with Connect-It when address values are stored in a text field or a collection Document ID: KM438373

 

Summary: The To.Address in Connect-It is a collection of elements so to be able to send an email to several users, each elements of the collection must be filled with one user address email by using pifSetStringVal() function. Two cases are possible: the address email values are stored in a text field with a specific character to separate them the address email values are stored in a collection of elements

 

Case 1: the address email values are stored in a text field with a specific character to separate them.

The field where the address email values are stored has to be parsed to extract one by one the address email values to build each element of the collection "To.Address".
The email address values are separated by a semi-colon.

The script will be:

dim address as string
dim position as long
dim count as integer
count = 0
address = ['user.to']
position = instr(0, address, chr(59), 0)
do while len(address) <> 0
  if position <> 0 then
    retval = pifsetstringval( "To(" & count & ").Address", left (address, position-1))
  else
    retval = pifsetstringval( "To(" & count & ").Address", address)
  end if
  address = RightPartFromLeft(address,chr(59),0)
  count = count + 1
  position = instr(0, address, chr(59), 0)
loop

This script must be applied directly on "To" collection, see the screen shot of the mapping :case1

 

Case 2: the address email values are stored in a collection of elements.

To be able to build each element of the collection "To.Address", a count of the source collection elements is necessary.
In this example, an email will be sent to each member of a group (AssetCenter database context)

The script will be:

dim count, i as integer
count = pifgetitemcount("Members")
pifloginfomsg count
for i = 0 to count-1
  retval = pifsetstringval("To("& i &").Address",[Members(i).EMail])
next i

This script must be applied directly on "To" collection, see the screen shot of the mapping :case2

 

 If you are able to access to HP SSO portal, please refer to the following document:

http://support.openview.hp.com/selfsolve/document/KM438373

http://support.openview.hp.com/selfsolve/document/KM816581

 

Thank you and Best regards,

HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
Also, please assign a Kudo to the post if you find it is helpful
Please use plain text.
HP Expert
NgocNgo
Posts: 214
Registered: ‎06-30-2013
Message 3 of 4 (148 Views)

Re: Connect-IT - Setting multiple mail addresses

Hi Sutot,

 

How about your problem now?

Does the provided information work?

 

Thank you and Best regards,

HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
Also, please assign a Kudo to the post if you find it is helpful
Please use plain text.
Occasional Advisor
Sutot
Posts: 19
Registered: ‎05-21-2012
Message 4 of 4 (139 Views)

Re: Connect-IT - Setting multiple mail addresses

Hi NgocNgo,

 

it works!

 

Thanks,

Sutot

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation