function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
unikevinunikevin 

SingleEmailMessage Error

Hi,
 
I'm trying to send email throw Ajaxtools, but I get the error code beolw:
 
faultcode: soapenv:Client 
faultstring: Element type "this.length" must be followed by either attribute specifications, ">" or "/>".
 
 
here are some code: ( form ajax toolkit guide) 
 
var singleRequest = new sforce.SingleEmailMessage();
singleRequest.replyTo = "jsmith@acme.com";
singleRequest.subject = "sent through ajax test driver";
singleRequest.plainTextBody = "this test went through ajax";
singleRequest.toAddresses = [uni@protime.com.cn];

var sendMailRes = sforce.connection.sendEmail([singleRequest]);
 
Anyone can help me?
thanks!
unikevinunikevin

sorry,

singleRequest.toAddresses = ['uni@protime.com.cn'];

benjasikbenjasik
see this blog post: http://blog.sforce.com/sforce/2007/07/send-emails-via.html

It links to some sample scontrol code to send emails
unikevinunikevin

thanks! I find a bug in AJAX Toolkits.

if the "toAddresses" only contains one email address, the toAddresses can't be an Array, it only can be a String! otherwise the "toAddresses" in SOAP message will be "for(var i=0;i<xxx.length;i++)..." then I get the error...

Ron HessRon Hess
toAddresses can be an array which contains only one string, does that work?
jf317820jf317820
This doesn't seem to work...I had to resort to a string.

Ron Hess wrote:
toAddresses can be an array which contains only one string, does that work?