C# Class PostmarkDotNet.PostmarkMessageBase

A message destined for the Postmark service.
Exibir arquivo Open project: wildbit/postmark-dotnet

Public Methods

Method Description
AddAttachment ( Stream contentStream, string attachmentName, string contentType = "application/octet-stream", string contentId = null ) : void

Adds a file attachment stream with inline support.

AddAttachment ( byte content, string contentType, string attachmentName ) : void

Adds a file attachment using a byte[] array

AddAttachment ( byte content, string contentType, string attachmentName, string contentId ) : void

Adds a file attachment using a byte[] array with inline support

AddAttachment ( string path ) : void

Adds a file attachment. Assumes the content type default of "application/octet-stream".

AddAttachment ( string path, string contentType ) : void

Adds a file attachment.

AddAttachment ( string path, string contentType, string contentId ) : void

Adds a file attachment with an inline image.

PostmarkMessageBase ( ) : System

Initializes a new instance of the PostmarkMessage class.

PostmarkMessageBase ( ) : System.Collections.Specialized

Initializes a new instance of the PostmarkMessage class.

Protected Methods

Method Description
GetMailMessageBcc ( MailMessage message ) : void
GetMailMessageCc ( MailMessage message ) : void
GetMailMessageRecipients ( MailMessage message ) : void
GetMailMessageTo ( MailMessage message ) : void
GetStringFromView ( AttachmentBase view ) : string
ReadStream ( Stream input, int bufferSize ) : byte[]
ValidateAttachmentLength ( string content ) : void

Restrict attacments to 10 mb. The API will do this anyway but this is faster

ValidateAttachmentPath ( string path ) : void

Be sure the path to the attachment actually exists

resolveViewEncoding ( AttachmentBase view, Encoding fallbackEncoding ) : Encoding

Method Details

AddAttachment() public method

Adds a file attachment stream with inline support.
public AddAttachment ( Stream contentStream, string attachmentName, string contentType = "application/octet-stream", string contentId = null ) : void
contentStream Stream An opened stream of the file attachments.
attachmentName string The file name assocatiated with the attachment.
contentType string The content type.
contentId string The ContentId for inlined images.
return void

AddAttachment() public method

Adds a file attachment using a byte[] array
public AddAttachment ( byte content, string contentType, string attachmentName ) : void
content byte
contentType string ContentID for inline images.
attachmentName string
return void

AddAttachment() public method

Adds a file attachment using a byte[] array with inline support
public AddAttachment ( byte content, string contentType, string attachmentName, string contentId ) : void
content byte
contentType string The content type.
attachmentName string
contentId string The ContentId for inline images.
return void

AddAttachment() public method

Adds a file attachment. Assumes the content type default of "application/octet-stream".
public AddAttachment ( string path ) : void
path string The full path to the file to attach
return void

AddAttachment() public method

Adds a file attachment.
public AddAttachment ( string path, string contentType ) : void
path string The full path to the file to attach
contentType string The content type.
return void

AddAttachment() public method

Adds a file attachment with an inline image.
public AddAttachment ( string path, string contentType, string contentId ) : void
path string The full path to the file to attach
contentType string The content type.
contentId string ContentID for inline images
return void

GetMailMessageBcc() protected method

protected GetMailMessageBcc ( MailMessage message ) : void
message MailMessage
return void

GetMailMessageCc() protected method

protected GetMailMessageCc ( MailMessage message ) : void
message MailMessage
return void

GetMailMessageRecipients() protected method

protected GetMailMessageRecipients ( MailMessage message ) : void
message MailMessage
return void

GetMailMessageTo() protected method

protected GetMailMessageTo ( MailMessage message ) : void
message MailMessage
return void

GetStringFromView() protected static method

protected static GetStringFromView ( AttachmentBase view ) : string
view AttachmentBase
return string

PostmarkMessageBase() public method

Initializes a new instance of the PostmarkMessage class.
public PostmarkMessageBase ( ) : System
return System

PostmarkMessageBase() public method

Initializes a new instance of the PostmarkMessage class.
public PostmarkMessageBase ( ) : System.Collections.Specialized
return System.Collections.Specialized

ReadStream() protected static method

protected static ReadStream ( Stream input, int bufferSize ) : byte[]
input Stream
bufferSize int
return byte[]

ValidateAttachmentLength() protected static method

Restrict attacments to 10 mb. The API will do this anyway but this is faster
protected static ValidateAttachmentLength ( string content ) : void
content string
return void

ValidateAttachmentPath() protected static method

Be sure the path to the attachment actually exists
protected static ValidateAttachmentPath ( string path ) : void
path string
return void

resolveViewEncoding() protected static method

protected static resolveViewEncoding ( AttachmentBase view, Encoding fallbackEncoding ) : Encoding
view AttachmentBase
fallbackEncoding Encoding
return Encoding