Package com.mailersend.sdk.emails
Class Attachment
- java.lang.Object
-
- com.mailersend.sdk.emails.Attachment
-
public class Attachment extends Object
Attachment class.
- Version:
- $Id: $Id
- Author:
- mailersend
-
-
Constructor Summary
Constructors Constructor Description Attachment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidAddAttachmentFromFile(String path)Reads a file, encodes it to base64 and sets it as an attachmentvoidAddImageFromFile(String contentId, String path)Reads a file, encodes it to base64 and sets it as an attachmentvoidsetAttachment(String content, String filename)Sets an attachments contents and filenamevoidsetDisposition(boolean inline)Sets the disposition of this attachment.voidsetImage(String contentId, String content, String filename)Sets an attachments contents and filename
-
-
-
Method Detail
-
AddAttachmentFromFile
public void AddAttachmentFromFile(String path) throws IOException
Reads a file, encodes it to base64 and sets it as an attachment- Parameters:
path- aStringobject.- Throws:
IOException
-
setAttachment
public void setAttachment(String content, String filename)
Sets an attachments contents and filename- Parameters:
content- The base64 contents of the attachmentfilename- aStringobject.
-
AddImageFromFile
public void AddImageFromFile(String contentId, String path) throws IOException
Reads a file, encodes it to base64 and sets it as an attachment- Parameters:
contentId- The contentId of the image. If set and not empty, disposition will be set to inline, else to attachmentpath- aStringobject.- Throws:
IOException
-
setImage
public void setImage(String contentId, String content, String filename)
Sets an attachments contents and filename- Parameters:
contentId- The contentId of the image. If set and not empty, disposition will be set to inline, else to attachmentcontent- The base64 contents of the attachmentfilename- aStringobject.
-
setDisposition
public void setDisposition(boolean inline)
Sets the disposition of this attachment.- Parameters:
inline- If set to true, disposition will be set to "inline", if false to "attachment"
-
-