Jmail組件發(fā)送及收郵件的asp代碼 一
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
w3 jmail中文使用說(shuō)明:[br]jmail.smtpmail[br][br]body : string[br] (v3.0)[br] 信件體,正文,使用appendtext追加內(nèi)容[br] 如:jmail.body = "hello world"[br]charset : string[br] (v3.0)[br] 字符集,缺省為"us-ascii"[br] 如:jmail.charset = "us-ascii"[br][br]contenttransferencoding : string[br] (v3.0)[br] 指定內(nèi)容傳送時(shí)的編碼方式,缺省是"quoted-printable"[br] 如:jmail.contenttransferencoding = "base64"[br][br]contenttype : string[br] (v3.0)[br] 信件的contentype. 缺省是"text/plain",但是可以設(shè)置為其他你想要的類(lèi)型.[br] 如果你以html格式發(fā)送郵件, 改為"text/html"即可。[br] 如:jmail.contenttype = "text/html"[br]deferreddelivery : date[br] (v3.0)[br] 設(shè)置延期發(fā)送. 如果郵件服務(wù)器支持的話(huà),消息到了這個(gè)時(shí)間才會(huì)發(fā)送[br] 如:(javascript)jmail.deferreddelivery = new date( 2000, 02, 17 ).getvardate();[br]encoding : string[br] (v3.0)[br] 這個(gè)屬性可以用來(lái)改變附件編碼方式(缺省是"base64). 可以選擇使用的是"base64", "uuencode" or "quoted-printable"[br] 如:jmail.encoding = "base64"[br]errorcode : integer[br] (v3.0)[br] 如果jmail.silent設(shè)置為true,errorcode包含的是錯(cuò)誤代碼[br] 如:response.write( jmail.errorcode );[br]errormessage : string[br] (v3.0)[br] 如果jmail.silent設(shè)置為true,包含的是錯(cuò)誤信息[br] 如:response.write( jmail.errormessage );[br]errorsource : string[br] (v3.0)[br] contains the error source if jmail.silent is set to true[br] 如:response.write( jmail.errorsource ); [br]isoencodeheaders : boolean[br] (v3.0)[br] 是否將信頭編碼成iso-8859-1字符集. 缺省是true[br] 如:jmail.isoencodeheaders = false[br]lazysend : boolean[br] (v3.0)[br][br] 這個(gè)屬性指定jmail是否一直等到mail發(fā)送了然后返回,或者緩沖這條消息然后在后臺(tái)發(fā)送。[br] 然而設(shè)置了這個(gè)屬性,你就不能控制錯(cuò)誤信息。[br] 注意:如果選擇了這個(gè)選項(xiàng),屬性serveraddress將無(wú)效,lazysend將通過(guò)dsn查詢(xún)決定郵件服務(wù)器,[br] 在一些設(shè)置里面,這可能有問(wèn)題。[br] 如:jmail.lazysend = true;[br]log : string[br] (v3.0)[br] jmail創(chuàng)建的日志,如果loging屬性設(shè)置為true[br] 如:response.write( jmail.log );[br]logging : boolean[br] (v3.0)[br] 是否使用日志[br] 如:jmail.logging = true[br]maildomain : string[br] (v3.0)[br] this can be used to override the ehlo/helo statement to your mailserver[br] 如:jmail.maildomain = "hello.world.com"[br]mimeversion : string[br] (v3.0)[br] 指定mime版本。缺省是"1.0"[br] 如:jmail.mimeversion = "1.0"[br]priority : integer[br] (v3.0)[br] 優(yōu)先級(jí). 范圍在1-5之間[br] 1 高優(yōu)先級(jí). 有些郵件程序稱(chēng)之為緊急[br] 2 也是高優(yōu)先級(jí)[br] 3 普通優(yōu)先級(jí)[br] 4 低優(yōu)先級(jí)[br] 5 最低的優(yōu)先級(jí)[br] 如:jmail.priority = 3[br]recipients : string[br] (v3.0)[br] 只讀屬性,返回所有收件人[br] 如:response.write( "" + jmail.recipients + "" );[br]replyto : string[br] (v3.0)[br] 指定一個(gè)可選的回信地址[br] 如:jmail.replyto = "president@dimac.net"[br]returnreceipt : boolean[br] (v3.0)[br] 指定是否發(fā)件人需要一個(gè)回復(fù)收據(jù). 缺省是false[br] 如:jmail.returnreceipt = true[br]sender : string[br] (v3.0)[br] 指定發(fā)件人的郵件地址[br] 如:jmail.sender = "batman@dimac.net"[br]sendername : string[br] (v3.0)[br] 指定發(fā)件人的姓名[br] 如:jmail.sendername = "bat man"[br]serveraddress : string[br] (v3.0)[br] 指定郵件服務(wù)器的地址。可以指定多個(gè)服務(wù)器,用分號(hào)點(diǎn)開(kāi)??梢灾付ǘ丝谔?hào)。[br] 如果serveraddress保持空白,jmail會(huì)嘗試解決遠(yuǎn)程郵件服務(wù)器,然后直接發(fā)送到服務(wù)器上去。[br] 如:jmail.serveraddress = "mail.mydom.net; mail2.mydom.net:2500" [br]silent : boolean[br] (v3.0)[br] 如果設(shè)置為true,jmail不會(huì)拋出例外錯(cuò)誤. jmail.execute() 會(huì)根據(jù)操作結(jié)果返回true或false[br] 如:jmail.silent = true[br]simplelayout : boolean[br] (v3.0)[br] 設(shè)置為true,減少jmail產(chǎn)生的header信頭[br] 如:jmail.simplelayout = true[br]subject : string[br] (v3.0)[br] 設(shè)定消息的標(biāo)題[br] 如:jmail.subject = "dimac rocks big time!"[br]usepipelining : boolean[br] (v3.0)[br] overrides if jmail should use pipelining on a server that supports it.[br] 如:jmail.pipelining = false [br]addattachment( filename, [contenttype] )[br] (v3.0)[br] 添加文件附件到信件[br] 如:jmail.addattachment( "c:\\autoexec.bat" );[br]addcustomattachment( filename, data )[br] (v3.0)[br] 添加自定義附件. this can be used to attach "virtual files" like a generated text string or certificate etc.[br] 如:jmail.addcustomattachment( "readme.txt", "contents of file" );[br]addheader( xheader, value )[br] (v3.0)[br] 添加用戶(hù)定義的x-header到message[br] 如:jmail.addheader( "originating-ip","193.15.14.623" );[br]addnativeheader( header, value )[br] (v3.0)[br] 添加信頭[br] 如:jmail.addnativeheader( "mta-settings", "route" );[br]addrecipient( email )[br] (v3.0)[br] 增加收件人[br] 如:jmail.addrecipient( "info@dimac.net" );[br]addrecipientbcc( email )[br] (v3.0)[br] 增加密件收件人[br] 如:jmail.addrecipientbcc( "someone@somedomain.net" );[br]addrecipientcc( email )[br] (v3.0)[br] 增加抄送收件人[br] 如:jmail.addrecipientcc( "someone@somedomain.net" );[br]addrecipientex( email, name )[br] (v3.0)[br] 增加一個(gè)帶名字的收件人[br] 如:jmail.addrecipientex( "info@dimac.net", "dimac info" );[br]addurlattachment( bstrurl, bstrattachas, [bstrauth] )[br] (v3.0)[br] 下載并添加一個(gè)來(lái)自u(píng)rl的附件. 第二個(gè)參數(shù)"attachas", 被用來(lái)指定信件收到后的文件名. 第3個(gè)可選參數(shù)是用來(lái)可選的www-鑒定.[br] 如:jmail.addurlattachment( "http://download.dimac.net/jmail/jmail.exe", "jmail.exe" )[br]appendbodyfromfile( filename )[br] (v3.0)[br] 將一個(gè)文件內(nèi)容追加到正文后[br] 如:jmail.appendbodyfromfile( "c:\\mytext.txt" );[br]appendtext( text )[br] (v3.0)[br] 追加信件的正文內(nèi)容[br] 如:jmail.appendtext( "text appended to message body" );[br]clearattachments()[br] (v3.0)[br] 清除附件列表[br] 如:jmail.clearattachments();[br]clearcustomheaders()[br] (v3.0)[br] 清除所有自定義的信頭[br] 如:jmail.clearcustomheaders();[br][br]clearrecipients()[br] (v3.0)[br] 清除收件人列表[br] 如:jmail.clearrecipients();[br]close()[br] (v3.0)[br] 強(qiáng)制jmail關(guān)閉緩沖的與郵件服務(wù)器的連接[br] 如:jmail.close();[br]execute() : boolean[br] (v3.0)[br] 執(zhí)行郵件的發(fā)送[br] 如:jmail.execute();[br]extractemailaddressesfromurl( bstrurl, [bstrauth] )[br] (v3.0)[br] 從一個(gè)url下載和添加email地址[br] 如:jmail.extractemailaddressesfromurl( "http://duplo.org/generateemaillist.asp" );[br]getmessagebodyfromurl( bstrurl, [bstrauth] )[br] (v3.0)[br] 清除message的正文,并用url的內(nèi)容替換。contenttype 會(huì)自動(dòng)設(shè)置成url的contentyp。第二參數(shù)(login and password)是可選的。[br] 如:jmail.getmessagebodyfromurl( "http://duplo.org/", "login:password" )[br][br]logcustommessage( message )[br] (v3.0)[br] 將用戶(hù)自定義消息加入jmail日志. 只有屬性loging設(shè)置為true時(shí),這項(xiàng)功能才能起作用[br] 如:jmail.logcustommessage( "hello world" );[br][br][br]====================================================================================[br]<%[br]dim jmail, contentid[br]set jmail = server.createobject("jmail.message") [br][br]jmail.charset = "gb2312" ' 郵件字符集,默認(rèn)為"us-ascii"[br]' jmail.isoencodeheaders = false ' 是否進(jìn)行iso編碼,默認(rèn)為true[br][br]' 發(fā)送者信息(可用變量方式賦值)[br]jmail.from = "jiaz@21cn.com" ' 發(fā)送者地址[br]jmail.fromname = "d.j." ' 發(fā)送者姓名[br]jmail.subject = "您在炫網(wǎng)資訊的歌詞快遞(請(qǐng)將編碼設(shè)為簡(jiǎn)體中文(gb2312))" ' 郵件主題[br][br]' 身份驗(yàn)證[br]jmail.mailserverusername = "user" ' 身份驗(yàn)證的用戶(hù)名,可能和jmail.from的值一樣,或?yàn)锧前的部分[br]jmail.mailserverpassword = "password" ' 身份驗(yàn)證的密碼[br][br]' 設(shè)置優(yōu)先級(jí),范圍從1到5,越大的優(yōu)先級(jí)越高,3為普通[br]jmail.priority = 3[br][br]jmail.addheader "originating-ip", request.servervariables("remote_addr")[br][br]' 加入一個(gè)收件人【變量email:收件人地址】可以同一語(yǔ)句重復(fù)加入多個(gè)[br]jmail.addrecipient(email)[br][br]' 加入附件【變量filename:附件文件的絕對(duì)地址,確保用戶(hù)iusr_????有訪(fǎng)問(wèn)的權(quán)限】[br]' 【參數(shù)設(shè)置是(true)否(false)為inline方式】[br]contentid = jmail.addattachment (filename, true)[br][br]' 郵件主體(html(注意信件內(nèi)鏈接附件的方式))[br]jmail.htmlbody = "
該文章在 2010/7/3 10:48:21 編輯過(guò) |
關(guān)鍵字查詢(xún)
相關(guān)文章
正在查詢(xún)... |