asp下jmail发邮件函数

 

该函数是根据某网上一函数改编而来的,至于是什么时候改的我也不记得了。
<%
'sent_address 发送者地址
'sent_name 发送者姓名
'sent_them 邮件主题
'sent_username 邮箱用户名
'sent_password 邮箱密码
'receive_address 接收者地址
'receive_htmlbody 邮件html内容
'receive_body 邮件纯内容
'sent_pop 邮件服务器
sub sent_email(sent_username,sent_password,sent_pop,sent_address,sent_name,sent_them,receive_address,receive_htmlbody)

On error resume next
Dim JMail, contentId
Set JMail = Server.CreateObject("JMail.Message")
JMail.Charset = "gb2312"
JMail.From = trim(sent_address)
JMail.FromName = trim(sent_name)
JMail.Subject = trim(sent_them)
JMail.MailServerUserName = trim(sent_username)
JMail.MailServerPassword = trim(sent_password)
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.AddRecipient(trim(receive_address))
JMail.HTMLBody = trim(receive_htmlbody)
JMail.Body = "我们的邮件采用了HTML格式,但是您的邮件查看软件可能不支持。"
JMail.Send(trim(sent_pop))
JMail.Close()
Set JMail = Nothing

if err.number<>0 then
response.write "<script language='javascript'>alert(""发送失败!"");</script>"
else
response.write "<script language='javascript'>alert(""发送成功!"");</script>"
end if

end sub
%>

调用该函数用

<%
call sent_email("")
%>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值