1
我发送电子邮件与3附件它工作正常,但当附件文件大小很大,然后它添加额外的扩展名与文件名即test.pdf随(test.pdf。 HTML)在我的电子邮件和邮件去SPAM文件夹。下面是 是我的代码。Salesforce电子邮件发送与附件添加额外的扩展名.html
if(strAttachFile != null && strAttachFile != '' && fileBody != null) {
Messaging.Emailfileattachment efa1 = new Messaging.Emailfileattachment();
efa1.setFileName(objAttachment1.Name);
efa1.setbody(objAttachment1.Body);
fileAttachments.add(efa1);
}
if(strAttachFile1 != null && strAttachFile1 != '' && fileBody1 != null) {
Messaging.Emailfileattachment efa2 = new Messaging.Emailfileattachment();
efa2.setFileName(objAttachment2.Name);
efa2.setbody(objAttachment2.Body);
fileAttachments.add(efa2);
system.debug('---fileAttachments---'+fileAttachments);
}
if(strAttachFile2 != null && strAttachFile2 != '' && fileBody2 != null) {
Messaging.Emailfileattachment efa3 = new Messaging.Emailfileattachment();
efa3.setFileName(objAttachment3.Name);
efa3.setbody(objAttachment3.Body);
fileAttachments.add(efa3);
}
mail.setFileAttachments(fileAttachments);
system.debug('---mail---'+mail);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
1)有没有办法禁用此设置? 2)我如何从Salesforce发送一封绕过Force.com服务器的电子邮件 - 通过webservice而不是通过Messaging.sendEmail()? – 2015-05-26 15:10:38