Table of Contents

Class ImplicitMailer

Namespace
ZapLib
Assembly
ZapLib.dll

使用隱式 SSL 加密連線協議的 SMTP 寄信工具

public class ImplicitMailer
Inheritance
ImplicitMailer
Inherited Members

Constructors

ImplicitMailer(string, string, string, int, bool, int)

建構子,初始化必要 SMTP 物件

public ImplicitMailer(string MAIL_HOST, string MAIL_ACT, string MAIL_PWD, int MAIL_PORT = 465, bool MAIL_SSL = true, int MAIL_RETRY = 1)

Parameters

MAIL_HOST string

SMTP Server 位置

MAIL_ACT string

登入帳號

MAIL_PWD string

登入密碼

MAIL_PORT int

隱式 SSL 加密 SMTP Server 埠號,預設 465

MAIL_SSL bool

是否啟用 SSL (true: Ssl , false: auto )

MAIL_RETRY int

是否啟用失敗重寄機制,預設為啟用

Properties

AttachmentsList

郵件的附件列表

public List<MimeAttachment> AttachmentsList { get; }

Property Value

List<MimeAttachment>

AuthenticationType

登入驗證類型,預設 Base64

public AuthenticationType AuthenticationType { get; set; }

Property Value

AuthenticationType

ErrMsg

錯誤訊息

public string ErrMsg { get; }

Property Value

string

MimeMailMessage

郵件本體物件

public MimeMailMessage MimeMailMessage { get; }

Property Value

MimeMailMessage

MimeMailer

隱式SSL SMTPS 寄信物件

public MimeMailer MimeMailer { get; }

Property Value

MimeMailer

SecureSocketOption

使用連線的加密協議

public SslMode SecureSocketOption { get; set; }

Property Value

SslMode

Methods

AddAttachments(string)

新增郵件附加檔案,回傳檔案的 content id

public string AddAttachments(string path)

Parameters

path string

檔案實體路徑,如果檔案不存在則回傳 null

Returns

string

檔案的 content id

Send(string, string, string, string, string, string[])

送出郵件

public bool Send(string to, string subject, string body, string cc = null, string bcc = null, string[] attchments = null)

Parameters

to string

發送到指定 email 位置,多個用逗號隔開

subject string

信件主旨

body string

信件內文

cc string

副本 (不需要可傳 NULL)

bcc string

密件副本 (不需要可傳 NULL)

attchments string[]

多個附件(實體檔案路徑字串陣列)

Returns

bool