3

Trying to use sendEmail() SOAP functionality (generating XML as in this example).

According to the sendEmail() documentation you can use a list of emails in the toAddresses field.

How are these delimited in the SOAP XML message? I have tried space and comma but neither seems to work.

3

2 Answers 2

3

They are not delimited within the <toAddresses> element instead you should have multiple <toAddresses> elements, one for each address.

1

It's not delimited, you provide an array of strings, where each item in the array is an email address you want to send to.

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[] {'[email protected]'};
mail.setToAddresses(toAddresses);
7
  • I am constructing the XML myself. How are they delimited in the XML?
    – leighman
    Feb 20, 2013 at 11:27
  • 1
    Aha, but you didn't say anything about SOAP before, i'm sorry, I don't have experience with the SOAP API nor constructing it via XML
    – pjcarly
    Feb 20, 2013 at 11:50
  • 1
    @PJC Always i prefer watching the Tag:). Feb 20, 2013 at 11:53
  • 1
    Just wondering if there's a reason you're not just using the wrapper classes in Java / C# which would generate the XML for you ? Feb 20, 2013 at 11:58
  • I did mention SOAP but didn't make it clear that I needed to construct the XML myself. Sorry. I am working on a desktop C app so cannot use the Java / C# examples.
    – leighman
    Feb 20, 2013 at 12:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .