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_HOSTstringSMTP Server 位置
MAIL_ACTstring登入帳號
MAIL_PWDstring登入密碼
MAIL_PORTint隱式 SSL 加密 SMTP Server 埠號,預設 465
MAIL_SSLbool是否啟用 SSL (true: Ssl , false: auto )
MAIL_RETRYint是否啟用失敗重寄機制,預設為啟用
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
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
pathstring檔案實體路徑,如果檔案不存在則回傳 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
tostring發送到指定 email 位置,多個用逗號隔開
subjectstring信件主旨
bodystring信件內文
ccstring副本 (不需要可傳 NULL)
bccstring密件副本 (不需要可傳 NULL)
attchmentsstring[]多個附件(實體檔案路徑字串陣列)