sendmail.asp

<%

Dim jmail,mailBody,fs,txtfs,strsql,strdate,strid

Dim Conn,RsName,strename,strw,strm,rw,strduedate,strpcp

 

set Conn = CreateObject ("ADODB.Connection")

Conn.Open "Provider=MSDataShape; DATA PROVIDER=SQLOLEDB.1;Password=**;Persist Security Info=True;User ID=**;Initial Catalog=**;Data Source=**"

 

strsql="select emp_id,Login_name,paphno,mdate from papayh,am_employee where mdate<year(dateadd(month,-1,getdate()))*10000+month(dateadd(month,-1,getdate()))*100+day(dateadd(month,-1,getdate())) and paphno not in (select papayno from prepd a,fm_form_header b where form_kind='bqs.form.t030' and form_no=predno and form_status in ('WP','WA','UA','AP')) and papayh.preq=am_employee.emp_id"

set RsName=Conn.Execute(strsql)

if not RsName.eof then

       do while not RsName.eof

Set jmail = CreateObject("JMail.Message") 

strename=RsName("Login_Name")

intformno=RsName("paphno")

strid=RsName("emp_id") 

strborrowdte=left(trim(RsName("mdate")),4) & "/" & mid(trim(RsName("mdate")),5,2) & "/" & right(trim(RsName("mdate")),2)

streml=replace(strename," ","")+"@benq.com"

strsql="select (select replace(login_name,' ','')+'@benq.com' from am_employee where emp_id=approver_id) as meml from am_approve_list where emp_id='"& strid &"' and approver_sequence<=2"

set rsmeml=Conn.Execute(strsql)

set rsmeml=nothing

if not rsmeml.eof then

do while not rsmeml.eof

rsmeml.movenext

loop

end if

set rsmeml=nothing

             set fs = CreateObject("Scripting.FileSystemObject")

set txtf = fs.OpenTextFile("//**/e$/Mail/epayment.htm")

mailBody = ""

if not txtf.atEndOfStream then

mailBody = txtf.ReadAll

end if

mailBody = replace(mailBody,"##ename##",strename)

mailBody = replace(mailBody,"##borrowdte##",strborrowdte)

mailBody = replace(mailBody,"##formno##",intformno)

mailBody = replace(mailBody,"##strdate##",strdate)

jmail.AddRecipient "**@**.com"

jmail.AddRecipientBCC "**@**.com"

jmail.From = "**@**.com"

jmail.FromName="**"

jmail.Logging = True

jmail.Silent = True

jmail.ContentType = "text/html"

jmail.Charset = "GB2312" 

jmail.Subject = "提醒( " &year(Date)&"/"&month(date)&"/"&Day(Date)& " )" 

jmail.Body = ""

jmail.HTMLBody=mailBody

jmail.Send( "**" )

set jmail = Nothing

set fs = Nothing

RsName.movenext

    Loop

end if

set Conn = Nothing

%>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值