国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

vbs定時(shí)發(fā)送郵件的方法與代碼

2019-10-26 17:58:29
字體:
供稿:網(wǎng)友
'用VBS寫個(gè)腳本,然后用WINDOWS平臺(tái)下的計(jì)劃任務(wù)來調(diào)用,每天定時(shí)群發(fā)郵件. 
'代碼如下:  下載地址 http://www.51tiao.com/info.vbs
復(fù)制代碼 代碼如下:

Dim connstr,conn 
Dim sql,rs,msg 

Sub OpenDB() 
    ConnStr = "DSN=51tiao.Com;UID=sa;PWD=;" 
    If Not IsObject(Conn) Then 
        Set conn = CreateObject("Adodb.Connection") 
        Conn.Open ConnStr 
    End If 
End Sub 

OpenDB() 
Send() 
CloseDB() 

Sub Send() 
    On Error Resume Next '有錯(cuò)繼續(xù)執(zhí)行 
    '郵件內(nèi)容 
    msg = "<html><head><title>上海跳蚤市場(chǎng)今日推薦 "&Date()&"</title>"&VBCRLF _ 
    &"<META NAME=""Author"" CONTENT=""清風(fēng), QQ: 110125707, MSN: anwellsz@msn.com"">"&VBCRLF _ 
    &"<style type='text/css'>"&VBCRLF _ 
    &"<!--"&vbcrlf _ 
    &"td,form,select,input,p,table,.font {font-size: 12px;line-height: 20px}"&VBCRLF _ 
    &"a:link {  color: #000000;  font-size: 12px; text-decoration: none}"&VBCRLF _ 
    &"a:visited {  color: #000000; font-size: 12px; text-decoration: none}"&VBCRLF _ 
    &"a:hover {  color: #ff7f2c; font-size: 12px; text-decoration: underline}"&VBCRLF _ 
    &"-->"&VBCRLF _ 
    &"</style>"&VBCRLF _ 
    &"</head><body>"&VBCRLF _ 
    &"<table width=640>"&VBCRLF _ 
    &"<tr><td align=right>今日推薦信息  "&Year(Date())&"年"&Month(Date())&"月"&Day(Date())&"日  <a href=""http://www.51tiao.com"" target=""_blank""><FONT size=3><b>上海跳蚤市場(chǎng)</b></font></a>    </td></tr></table></div></td></tr></table>"&VBCRLF _ 
    &"<table width=640>"&VBCRLF _ 
    &"<tr bgColor='#FF9D5C'><td height=3></td></tr><tr><td> </td></tr><tr>"&VBCRLF _ 
    &"<td>"&VBCRLF _ 
    &"  <ul>"&VBCRLF _ 
    &"    <p>" 
    sql = "select distinct top 100 a.infoid,a.Strtitle from newinfoarticle a "_ 
    &"inner join Newinfoprop b "_ 
    &"on a.infoid = b.infoid and a.intgood = 1 and a.intshenhe = 1 and b.rid1 = 908 and datediff(d,createtime,getdate())=0 "_ 
    &"order by a.infoid desc" 
    Set rs = conn.execute(sql) 
    If rs.eof Then 
        Wscript.Echo "沒有記錄!" 
        rs.close : Set rs = Nothing 
        Exit Sub 
    End If 
    Do While Not rs.eof 
        msg = msg&"★ <a href=""http://www.51tiao.com/4/Show.asp?ID="&rs("infoid")&""" title = """&rs("strtitle")&""" target=""_blank"">"_ 
        &rs("Strtitle")&"</a><br>"&VBCRLF 
    Rs.MoveNext 
    Loop 
    Rs.close : set Rs=Nothing 
    msg = msg &  "</ul></p>"&VBCRLF _ 
    &"</td>"&VBCRLF _ 
    &"</tr><tr><td> </td></tr><tr bgColor='#FF9D5C'><td height=3></td></tr>"&VBCRLF _ 
    &"<tr align=right><td><a href=""http://www.51tiao.com"" target=""_blank""><FONT face='Arial Black' size=3>51Tiao.Com</FONT></a>      </td></tr>"&VBCRLF _ 
    &"</table><p></p></body></html>" 
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 玉溪市| 德保县| 涞水县| 宣武区| 固镇县| 诸暨市| 时尚| 大新县| 忻城县| 迁安市| 温宿县| 明溪县| 南城县| 富裕县| 贵溪市| 岳池县| 西藏| 永济市| 达尔| 利辛县| 迭部县| 饶平县| 巴林右旗| 修水县| 行唐县| 读书| 华宁县| 宜川县| 大港区| 深圳市| 崇文区| 得荣县| 沭阳县| 惠安县| 普兰店市| 河曲县| 汉源县| 明水县| 沙雅县| 佛学| 靖江市|