C# 클래스 SendGrid.Mail

상속: IMail
파일 보기 프로젝트 열기: advancedrei/sendgridplus-csharp

공개 메소드들

메소드 설명
AddAttachment ( Stream stream, string name ) : void

Add a stream as an attachment to the message

AddAttachment ( Stream stream, string name, string contentType ) : void

Add a stream as an attachment to the message

AddAttachment ( Stream stream, string name, string contentType, string contentId ) : void

Add a stream as an attachment to the message

AddAttachment ( string filePath ) : void

Add an attachment to the message.

AddBcc ( string>.IDictionary addresssInfo ) : void

Add to the 'Bcc' address.

AddBcc ( IEnumerable addresses ) : void

Add to the 'Bcc' address.

AddBcc ( string address ) : void

Add to the 'Bcc' address.

AddCc ( string>.IDictionary addresssInfo ) : void

Add to the 'CC' address.

AddCc ( IEnumerable addresses ) : void

Add to the 'CC' address.

AddCc ( string address ) : void

Add to the 'CC' address.

AddHeaders ( string>.IDictionary headers ) : void

Add custom headers to the message

AddSubstitution ( string replacementTag, List substitutionValues ) : void

Defines a mapping between a replacement string in the text of the message to a list of substitution values to be used, one per each recipient, in the same order as the recipients were added.

AddTo ( string>.IDictionary addresssInfo ) : void

Add to the 'To' address.

AddTo ( IEnumerable addresses ) : void

Add to the 'To' address.

AddTo ( string address ) : void

Add to the 'To' address.

AddUniqueIdentifiers ( string>.IDictionary identifiers ) : void

This adds parameters and values that will be passed back through SendGrid's Event API if an event notification is triggered by this email.

CreateMimeMessage ( ) : MailMessage

Used by the Transport object to create a MIME for SMTP

DisableBcc ( ) : void

Disable Bcc app

DisableBypassListManagement ( ) : void

Disable the Bypass List Management app

DisableClickTracking ( ) : void

Disable the click tracking app

DisableFooter ( ) : void

Disable the footer app

DisableGoogleAnalytics ( ) : void

Disable the Google Analytics app

DisableGravatar ( ) : void

Disable the gravatar app

DisableOpenTracking ( ) : void

Disable the open tracking app

DisableSpamCheck ( ) : void

Disable the spam check

DisableTemplate ( ) : void

Disable the templates app

DisableUnsubscribe ( ) : void

Disable the unsubscribe app

EnableBcc ( string email ) : void

Automatically sends a blind carbon copy to an address for every e-mail sent, without adding that address to the header.

EnableBypassListManagement ( ) : void

Enabing this app will bypass the normal unsubscribe / bounce / spam report checks and queue the e-mail for delivery.

EnableClickTracking ( bool includePlainText = false ) : void

Causes all links to be overwritten, shortened, and pointed to SendGrid's servers so clicks will be tracked.

EnableFooter ( string text = null, string html = null ) : void

Attaches a message at the footer of the email

EnableGoogleAnalytics ( string source, string medium, string term, string content = null, string campaign = null ) : void

Re-writes links to integrate with Google Analytics

EnableGravatar ( ) : void

Inserts the gravatar image of the sender to the bottom of the message

EnableOpenTracking ( ) : void

Adds an invisible image to the end of the email which can track e-mail opens.

EnableSpamCheck ( int score = 5, string url = null ) : void

Provides notification when emails are detected that exceed a predefined spam threshold.

EnableTemplate ( string html ) : void

Wraps an HTML template around your email content.

EnableUnsubscribe ( string replace ) : void

Allows SendGrid to manage unsubscribes and ensure these users don't get future emails from the sender

EnableUnsubscribe ( string text, string html ) : void

Allows SendGrid to manage unsubscribes and ensure these users don't get future emails from the sender

GetInstance ( ) : Mail

Creates an instance of SendGrid's custom message object

GetInstance ( MailAddress from, MailAddress to, MailAddress cc, MailAddress bcc, string subject, string html, string text ) : Mail

Creates an instance of SendGrid's custom message object with mail parameters

GetRecipients ( ) : IEnumerable

GetRecipients returns a list of all the recipients by retrieving the to, cc, and bcc lists.

SetCategories ( IEnumerable categories ) : void

SetCategory ( string category ) : void

This sets the category for this email. Statistics are stored on a per category basis, so this can be useful for tracking on a per group basis.

비공개 메소드들

메소드 설명
InitializeFilters ( ) : string>.Dictionary
Mail ( IHeader header ) : System
Mail ( MailAddress from, MailAddress to, MailAddress cc, MailAddress bcc, string subject, string html, string text, IHeader header = null ) : System
SaveMessage ( string directory ) : void

Helper function lets us look at the mime before it is sent

메소드 상세

AddAttachment() 공개 메소드

Add a stream as an attachment to the message
public AddAttachment ( Stream stream, string name ) : void
stream Stream Stream of file to be attached
name string Name of file to be attached
리턴 void

AddAttachment() 공개 메소드

Add a stream as an attachment to the message
public AddAttachment ( Stream stream, string name, string contentType ) : void
stream Stream Stream of file to be attached
name string Name of file to be attached
contentType string Content type of stream
리턴 void

AddAttachment() 공개 메소드

Add a stream as an attachment to the message
public AddAttachment ( Stream stream, string name, string contentType, string contentId ) : void
stream Stream Stream of file to be attached
name string Name of file to be attached
contentType string Content type of stream
contentId string ContentId for embedding images
리턴 void

AddAttachment() 공개 메소드

Add an attachment to the message.
public AddAttachment ( string filePath ) : void
filePath string a fully qualified file path as a string
리턴 void

AddBcc() 공개 메소드

Add to the 'Bcc' address.
public AddBcc ( string>.IDictionary addresssInfo ) : void
addresssInfo string>.IDictionary the dictionary keys are the email addresses, which points to a dictionary of /// key substitutionValues pairs mapping to other address codes, such as { [email protected] => { 'DisplayName' => 'Mr Foo' } }
리턴 void

AddBcc() 공개 메소드

Add to the 'Bcc' address.
public AddBcc ( IEnumerable addresses ) : void
addresses IEnumerable a list of emails as an array of strings.
리턴 void

AddBcc() 공개 메소드

Add to the 'Bcc' address.
public AddBcc ( string address ) : void
address string a single email as the input eg "[email protected]"
리턴 void

AddCc() 공개 메소드

Add to the 'CC' address.
public AddCc ( string>.IDictionary addresssInfo ) : void
addresssInfo string>.IDictionary the dictionary keys are the email addresses, which points to a dictionary of /// key substitutionValues pairs mapping to other address codes, such as { [email protected] => { 'DisplayName' => 'Mr Foo' } }
리턴 void

AddCc() 공개 메소드

Add to the 'CC' address.
public AddCc ( IEnumerable addresses ) : void
addresses IEnumerable a list of email addresses as strings
리턴 void

AddCc() 공개 메소드

Add to the 'CC' address.
public AddCc ( string address ) : void
address string a single email address eg "[email protected]"
리턴 void

AddHeaders() 공개 메소드

Add custom headers to the message
public AddHeaders ( string>.IDictionary headers ) : void
headers string>.IDictionary key substitutionValues pairs
리턴 void

AddSubstitution() 공개 메소드

Defines a mapping between a replacement string in the text of the message to a list of substitution values to be used, one per each recipient, in the same order as the recipients were added.
public AddSubstitution ( string replacementTag, List substitutionValues ) : void
replacementTag string the string in the email that you'll replace eg. '-name-'
substitutionValues List a list of values that will be substituted in for the replacementTag, one for each recipient
리턴 void

AddTo() 공개 메소드

Add to the 'To' address.
public AddTo ( string>.IDictionary addresssInfo ) : void
addresssInfo string>.IDictionary the dictionary keys are the email addresses, which points to a dictionary of /// key substitutionValues pairs mapping to other address codes, such as { [email protected] => { 'DisplayName' => 'Mr Foo' } }
리턴 void

AddTo() 공개 메소드

Add to the 'To' address.
public AddTo ( IEnumerable addresses ) : void
addresses IEnumerable list of email addresses as strings
리턴 void

AddTo() 공개 메소드

Add to the 'To' address.
public AddTo ( string address ) : void
address string single string eg. '[email protected]'
리턴 void

AddUniqueIdentifiers() 공개 메소드

This adds parameters and values that will be passed back through SendGrid's Event API if an event notification is triggered by this email.
public AddUniqueIdentifiers ( string>.IDictionary identifiers ) : void
identifiers string>.IDictionary parameter substitutionValues pairs to be passed back on event notification
리턴 void

CreateMimeMessage() 공개 메소드

Used by the Transport object to create a MIME for SMTP
public CreateMimeMessage ( ) : MailMessage
리턴 SendGrid.Net.Mail.MailMessage

DisableBcc() 공개 메소드

Disable Bcc app
public DisableBcc ( ) : void
리턴 void

DisableBypassListManagement() 공개 메소드

Disable the Bypass List Management app
public DisableBypassListManagement ( ) : void
리턴 void

DisableClickTracking() 공개 메소드

Disable the click tracking app
public DisableClickTracking ( ) : void
리턴 void

DisableFooter() 공개 메소드

Disable the footer app
public DisableFooter ( ) : void
리턴 void

DisableGoogleAnalytics() 공개 메소드

Disable the Google Analytics app
public DisableGoogleAnalytics ( ) : void
리턴 void

DisableGravatar() 공개 메소드

Disable the gravatar app
public DisableGravatar ( ) : void
리턴 void

DisableOpenTracking() 공개 메소드

Disable the open tracking app
public DisableOpenTracking ( ) : void
리턴 void

DisableSpamCheck() 공개 메소드

Disable the spam check
public DisableSpamCheck ( ) : void
리턴 void

DisableTemplate() 공개 메소드

Disable the templates app
public DisableTemplate ( ) : void
리턴 void

DisableUnsubscribe() 공개 메소드

Disable the unsubscribe app
public DisableUnsubscribe ( ) : void
리턴 void

EnableBcc() 공개 메소드

Automatically sends a blind carbon copy to an address for every e-mail sent, without adding that address to the header.
public EnableBcc ( string email ) : void
email string A single email recipient
리턴 void

EnableBypassListManagement() 공개 메소드

Enabing this app will bypass the normal unsubscribe / bounce / spam report checks and queue the e-mail for delivery.
public EnableBypassListManagement ( ) : void
리턴 void

EnableClickTracking() 공개 메소드

Causes all links to be overwritten, shortened, and pointed to SendGrid's servers so clicks will be tracked.
public EnableClickTracking ( bool includePlainText = false ) : void
includePlainText bool true if links found in plain text portions of the message are to be overwritten
리턴 void

EnableFooter() 공개 메소드

Attaches a message at the footer of the email
public EnableFooter ( string text = null, string html = null ) : void
text string Message for the plain text body of the email
html string Message for the HTML body of the email
리턴 void

EnableGoogleAnalytics() 공개 메소드

Re-writes links to integrate with Google Analytics
public EnableGoogleAnalytics ( string source, string medium, string term, string content = null, string campaign = null ) : void
source string Name of the referrer source (e.g. Google, SomeDomain.com, NewsletterA)
medium string Name of the marketing medium (e.g. Email)
term string Identify paid keywords
content string Use to differentiate ads
campaign string Name of the campaign
리턴 void

EnableGravatar() 공개 메소드

Inserts the gravatar image of the sender to the bottom of the message
public EnableGravatar ( ) : void
리턴 void

EnableOpenTracking() 공개 메소드

Adds an invisible image to the end of the email which can track e-mail opens.
public EnableOpenTracking ( ) : void
리턴 void

EnableSpamCheck() 공개 메소드

Provides notification when emails are detected that exceed a predefined spam threshold.
public EnableSpamCheck ( int score = 5, string url = null ) : void
score int Emails with a SpamAssassin score over this substitutionValues will be considered spam and not be delivered.
url string SendGrid will send an HTTP POST request to this url when a message is detected as spam
리턴 void

EnableTemplate() 공개 메소드

Wraps an HTML template around your email content.
public EnableTemplate ( string html ) : void
html string HTML that your emails will be wrapped in, containing a body replacementTag.
리턴 void

EnableUnsubscribe() 공개 메소드

Allows SendGrid to manage unsubscribes and ensure these users don't get future emails from the sender
public EnableUnsubscribe ( string replace ) : void
replace string Tag in the message body to be replaced with the unsubscribe link and message
리턴 void

EnableUnsubscribe() 공개 메소드

Allows SendGrid to manage unsubscribes and ensure these users don't get future emails from the sender
public EnableUnsubscribe ( string text, string html ) : void
text string string for the plain text email body showing what you want the message to look like.
html string string for the HTML email body showing what you want the message to look like.
리턴 void

GetInstance() 공개 정적인 메소드

Creates an instance of SendGrid's custom message object
public static GetInstance ( ) : Mail
리턴 Mail

GetInstance() 공개 정적인 메소드

Creates an instance of SendGrid's custom message object with mail parameters
public static GetInstance ( MailAddress from, MailAddress to, MailAddress cc, MailAddress bcc, string subject, string html, string text ) : Mail
from SendGrid.Net.Mail.MailAddress The email address of the sender
to SendGrid.Net.Mail.MailAddress An array of the recipients
cc SendGrid.Net.Mail.MailAddress Supported over SMTP, with future plans for support in the Web transport
bcc SendGrid.Net.Mail.MailAddress Blind recipients
subject string The subject of the message
html string the html content for the message
text string the plain text part of the message
리턴 Mail

GetRecipients() 공개 메소드

GetRecipients returns a list of all the recipients by retrieving the to, cc, and bcc lists.
public GetRecipients ( ) : IEnumerable
리턴 IEnumerable

SetCategories() 공개 메소드

public SetCategories ( IEnumerable categories ) : void
categories IEnumerable
리턴 void

SetCategory() 공개 메소드

This sets the category for this email. Statistics are stored on a per category basis, so this can be useful for tracking on a per group basis.
public SetCategory ( string category ) : void
category string categories applied to the message
리턴 void