發表文章

目前顯示的是有「ASP」標籤的文章

Jmail 範例程式

這支程式碼可以處理複數收件人的郵件寄發,使用密件副本讓收件者看不到你群發給誰。 Function SendMail(source,address,subject,body,smtpip) Dim Sender Dim Charset Dim Region Set jmail = Server.CreateObject("JMail.Message") '寄信前的一些設定 jmail.Charset = "big5" jmail.ContentType = "text/html" jmail.From = source '寄件人 jmail.Subject = subject '郵件主指 jmail.Silent = true jmail.ISOEncodeHeaders = false jmail.HTMLBody = body '//////////////////////////////////////////////////////////////////////////// '加入使用者地址,BCC是密件副本 for i = 0 to ubound(address)-1 jmail.AddRecipientBCC BCC(i) next '設定使用的SMTP的Server需要用到的用戶名稱和密碼。如果不需要寄件認證,可留白。 jmail.MailServerUserName = "exampleuser" jmail.MailServerPassword = "examplepassword" SendMail = jmail.Send(smtpip) '發出郵件 Set jmail = Nothing End Function Dim strContent '郵件內容 Dim BCC '收件人的陣列 strContent = "Something" '設定郵件內容 BCC = ("abc@123.com","cde@456.com",...

Jmail的屬性和方法

Body : String (v3.0) E-Mail的主體 JMail.Body = "Hello world" Charset : String (v3.0) 設定郵件的字符集,默認為"US-ASCII" JMail.Charset = "US-ASCII" ContentTransferEncoding : String (v3.0) 指定內容編碼, 默認為 "Quoted-Printable" JMail.ContentTransferEncoding = "base64" ContentType : String (v3.0) 這個郵件的頭設置, 默認為 "text/plain" 能設 置成你需要的任何情況。 你想發送HTML信息,改這個頭文件為 "text/html" JMail.ContentType = "text/html" DeferredDelivery : Date (v3.0) 設置時間。 如果MAILSERVER服務器支持,可以設置何時發送郵件。 JMail.DeferredDelivery = new Date( 2000, 02, 17 ).getVarDate(); Encoding : String (v3.0) This can be used to change the default Attachment encoding from base64. Valid options are "base64", "uuencode" or "quoted-printable" JMail.Encoding = "base64" ErrorCode : Integer (v3.0) 報錯誤信息,如果JMail.silent被設置成true Response.Write( JMail.ErrorCode ) ErrorMessage : String (v3.0) 報錯誤信息,如果JMail.silent被設置成true Response.Write( JMail.ErrorMessage ) Err...