EmailFileAttachment Class
EmailFileAttachment is used in SingleEmailMessage to specify attachments passed in as part of the request, as opposed to existing documents in Salesforce.
Sending an email by using Apex requires domain-level and user-level email verification. System-generated emails also require verification of the From email address. Email delivery fails if any of these verifications is incomplete. See Requirements to Send Email from Salesforce.
The following are constructors for EmailFileAttachment.
-
Creates a new instance of the
Messaging.EmailFileAttachmentclass.
Creates a new instance of the Messaging.EmailFileAttachment class.
public EmailFileAttachment()
The following are properties for EmailFileAttachment.
-
Gets or sets the attachment itself.
-
Gets or sets the attachment’s Content-Type.
-
Gets or sets the name of the file to attach.
-
Read-Only. Gets the attachment ID.
-
Specifies a Content-Disposition of inline (
true) or attachment (false).
Gets or sets the attachment itself.
public Blob body {get; set;}
Type: Blob
Gets or sets the attachment’s Content-Type.
public String contenttype {get; set;}
Type: String
Gets or sets the name of the file to attach.
public String filename {get; set;}
Type: String
Read-Only. Gets the attachment ID.
public Id id {get;}
Type: Id
Specifies a Content-Disposition of inline (true) or attachment (false).
public Boolean inline {get; set;}
Type: Boolean