You need to sign in to do that
Don't have an account?

Email attachment converting to html without any content
I am using Apex page Controller methods to read the attachments and send using email attachments. When I reach above 3MB it is converting html file. Is there any issue or limitation on email attachments?
Suppose my file name is testfile.pdf then it converts to testfile.pdf.html.
if the file size less than 3mb it sends testfile.pdf
Document says it supports 10MB. if the size is morethann 10mb then I get error message Limit exceeded.
My code looks like below:
Messaging.Singleemailmessage single_mail = new Messaging.Singleemailmessage();
Messaging.EmailFileAttachment[] fileAttachments = new Messaging.EmailFileAttachment[ShowFiles.size()];
for(integer cnt=0;cnt< fileAttachments.size(); cnt++)
{
Messaging.EmailFileAttachment fileAttachment = new Messaging.EmailFileAttachment();
fileAttachment.setBody(emailBodyBlob);
fileAttachment.setFileName(FileName);
fileAttachments[cnt] = fileAttachment;
}
single_mail.setFileAttachments(fileAttachments);
}
// Specify the text content of the email.
single_mail.setPlainTextBody(body);
// Send the email you have created.
Messaging.SendEmailResult[] result = Messaging.sendEmail(new Messaging.SingleEmailMessage[] { single_mail });
How can I send actual files upto10mb without converting to html.
This is due to the way salesforce sends attachments. To conserve bandwidth (and avoid compatibility issues with some mail services), attachments over 3MB are sent as links. The HTML file links to a CMS hosted by salesforce; opening the attachment will result in the file being downloaded. The CMS stores these attachments for 30 days, then discards the file. This is true any time an email is sent with attachments. You can verify this behavior by creating a contact record with your email address on it, and sending yourself a 5MB attachment as an example.
All Answers
This is due to the way salesforce sends attachments. To conserve bandwidth (and avoid compatibility issues with some mail services), attachments over 3MB are sent as links. The HTML file links to a CMS hosted by salesforce; opening the attachment will result in the file being downloaded. The CMS stores these attachments for 30 days, then discards the file. This is true any time an email is sent with attachments. You can verify this behavior by creating a contact record with your email address on it, and sending yourself a 5MB attachment as an example.
Thanss for letting us know. So is there any way we can send the actual file to the email and that will never be deleted?
The email must not be sent through the Force.com servers; all emails sent from clients through their servers are subject to this rule. Instead, consider using a third-party mailing system; most of them can integrate with Outbound Notifications or other means.