ASP发送邮件源码
ASP通过调用API接口发送邮件
<% ' '网吧数据 'www.zgw8.com '邮件发送接口调用demo ' ' '获取网页源代码函数 '================================================================ Function getHtml(url) '以HTML格式备份 Set xh = CreateObject("Microsoft.XMLHTTP") xh.Open "GET",url,0 xh.Send() Set MyStream=CreateObject("Adodb.Stream") MyStream.Type = 2 MyStream.Open MyStream.WriteText xh.responseText MyStream.Position = 0 getHtml=MyStream.ReadText MyStream.Close End Function '配置区域 '================================================================ key = "14294631611658671295816578756856" '定义KEY,从网吧数据网站获取 smtp = "smtp.qq.com" 'smtp地址,例如QQ的 smtp.qq.com 网易163邮箱是 smtp.163.com nicheng = "网吧数据" '发送邮件昵称 fajianxiang = "773003231@qq.com" '你的邮箱账号,此账号需要开启smtp服务,如果未开启,请先登录邮箱开启,一般在邮箱的“设置”里面开启 fajianxiangmima = "填写密码" '你的邮箱密码 shoujianxiang = "3039439790@qq.com" '接收此邮件的邮箱账号(发给谁) title = "您好" '邮件标题 content = "内容" '邮件内容 '================================================================ '处理区域 '================================================================ '//定义数据请求URL url = "http://www.zgw8.com/api.php/SendMail/Index/key/"&key&"/language/json/smtp/"&smtp&"/fajianrenmingcheng/"&nicheng&"/fajianrenyouxiang/"&fajianxiang&"/fajianrenyouxiangmima/"&fajianxiangmima&"/shoujianrenyouxiang/"&shoujianxiang&"/youjianbiaoti/"&title&"/youjianneirong/"&content html = getHtml(url) '//调用函数获取结果 '结果区 '结果赋值给了html变量 '========================= response.Write html'//输出结果 %>
所有评论(0)