2013-04-24 68 views
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 }); 

回答

2

这是由于Salesforce的发送附件,可能与附件的大小的方式。

Salesforce会自动将附件超过3mb并将其作为链接发送。

HTML文件链接,通过销售团队托管服务器和存储此文件为30天。(作为solotion电子邮件不得通过Force.com服务器发送。)

这是所有。

+0

1)有没有办法禁用此设置? 2)我如何从Salesforce发送一封绕过Force.com服务器的电子邮件 - 通过webservice而不是通过Messaging.sendEmail()? – 2015-05-26 15:10:38

相关问题