asp邮件发送

首先确认你已经安装了Jmail组件 <% Public Function SendMail(MailTitle,GetMailMan,MailBody,SendFrom,SendName,SendUser,SendPwd,SendSmtp) On Error Resume Next Set Jms = Server.CreateObject("jmail.Message") Jms.Charset = "GB2312" '编码 Jms.ContentType = "text/html" Jms.Subject = MailTitle '邮件标题 Jms.AddRecipient(GetMailMan) '接收人邮箱 Jms.Body = MailBody '邮件内容 Jms.From = SendFrom '发件人地址 Jms.FromName = SendName '发件人姓名 Jms.MailServerUserName = SendUser '发件人帐号 Jms.MailServerPassWord = SendPwd '发件人密码 Jms.Send(SendSmtp) '发件人邮箱smtp服务器 Jms.Close() Set Jms = Nothing If Err.number <> 0 then SendMail = "邮件发送失败!"& Err.Description Else SendMail = "邮件发送成功!" End If End Function MailTitle="邮件标题" MailBody="邮件内容" GetMailMan="接收人邮箱" SendName="发件人姓名" SendFrom="发件人邮箱" SendUser="发件人帐号" '一般可以直接填写邮箱地址,但某些像163的可以使用前面的账号名 SendPwd="发件人密码" SendSmtp="发件人邮箱smtp服务器" '目前个别邮箱不能试用这个功能,不过QQ邮箱可以(必须登陆QQ邮箱打勾开放“STMP功能”) call SendMail(MailTitle,GetMailMan,MailBody,SendFrom,SendName,SendUser,SendPwd,SendSmtp) %>
posted @ 2011-09-08 12:30  十年如一  阅读(386)  评论(0编辑  收藏  举报