-Dman100-
asked on
convert arrayList to string
I need to convert an arrayList to a string so I can pass the parameter into my method that requires a string parameter:
ArrayList repEmailList = RepresentationDAO.GetEmail List(anAdd ress.State Abr);
//foreach (string emailAddress in repEmailList)
SendMail.Send(repEmailList , "info@compasslearning.com" , "CompassLearning Sales Information Request", strmsg);
repEmailList needs to be converted to a string
Thanks for any help.
ArrayList repEmailList = RepresentationDAO.GetEmail
//foreach (string emailAddress in repEmailList)
SendMail.Send(repEmailList
repEmailList needs to be converted to a string
Thanks for any help.
ASKER
yes, I'm only sending one email to all recpients.
And I made a mistake in my code, it should have been:
string addresses = "";
foreach(string emailAddress in repEmailList)
addresses += (addresses=="" ? "" : ";") + emailAddress;
SendMail.Send(addresses...
But that should do it!
string addresses = "";
foreach(string emailAddress in repEmailList)
addresses += (addresses=="" ? "" : ";") + emailAddress;
SendMail.Send(addresses...
But that should do it!
ASKER
If I may ask, what is this line doing: addresses += (emailAddress=="" ? "" : ";") + emailAddress;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help! It works great!
Regards,
-D-
Regards,
-D-
string addresses = "";
foreach(string emailAddress in repEmailList)
addresses += (emailAddress=="" ? "" : ";") + emailAddress;
SendMail.Send(addresses, ...