Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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.

share|improve this question
    
So you tried message.setToAddresses(new String[] { "person3@salesforce.com", "person4@salesforce.com" }); –  techtrekker Feb 20 '13 at 11:22
1  
try semi-colon? –  Ray Feb 20 '13 at 13:51
    
semi-colon does not seem to work either... –  leighman Feb 26 '13 at 13:55
add comment

2 Answers 2

up vote 2 down vote accepted

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

share|improve this answer
add comment

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[] {'test@test.com'};
mail.setToAddresses(toAddresses);
share|improve this answer
    
I am constructing the XML myself. How are they delimited in the XML? –  leighman Feb 20 '13 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 –  PJC Feb 20 '13 at 11:50
1  
@PJC Always i prefer watching the Tag:). –  Mohith Shrivastava Feb 20 '13 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 ? –  techtrekker Feb 20 '13 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 '13 at 12:08
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.