Activity › Forums › Salesforce® Discussions › Messaging.EmailFileAttachment vs Messaging.singleEmailMessage in Salesforce?
Tagged: Difference, Messaging.EmailFileAttachment, Messaging.singleEmailMessage, Salesforce Development, Salesforce Implementation
-
Messaging.EmailFileAttachment vs Messaging.singleEmailMessage in Salesforce?
Posted by Shubham on August 10, 2017 at 2:00 PMDescribe the difference between two classes in Salesforce with example:
- Messaging.EmailFileAttachment
- Messaging.singleEmailMessage
Parul replied 7 years, 8 months ago 3 Members · 2 Replies -
2 Replies
-
Hello shubham,
SingleEmailMessage Methods :
Contains methods for sending single email messages.
Namespace
Messaging
Usage
All base email (Email class) methods are also available to the SingleEmailMessage objects.Email properties are readable and writable. Each property has corresponding setter and getter methods. For example, the toAddresses() property is equivalent to the setToAddresses() and getToAddresses() methods. Only the setter methods are documented.
EmailFileAttachment Class :
EmailFileAttachment is used in SingleEmailMessage to specify attachments passed in as part of the request, as opposed to existing documents in Salesforce. - [adinserter block='9']
-
SingleEmailMessage extends Email and inherits all of its methods. All base email (Email class) methods are also available to the SingleEmailMessage objects.
Email properties are readable and writable. Each property has corresponding setter and getter methods. For example, the toAddresses() property is equivalent to the setToAddresses() and getToAddresses() methods. Only the setter methods are documented. However, the getTemplateName() method doesn’t have an equivalent setter method; use setTemplateId() to specify a template name.
EmailFileAttachment is used in SingleEmailMessage to specify attachments passed in as part of the request, as opposed to existing documents in Salesforce.
Thanks
Log In to reply.