1.CDONTS.NewMail 在线发邮件 程序代码:
Type' content='text/html; charset=gb2312'><font color='FF0000'>测试内容</font>" '发件人 myMail.From = "domain@domain.com" '收件人 myMail.To = "domain@domain.com" '邮件的重要性 ' 0 重要性低 ' 1 重要性一般(默认) ' 2 重要性高 myMail.Importance = 2 '邮件主题 myMail.Subject = "测试" '给邮件对象的文本赋值 myMail.Body = HTML '将邮件发出 myMail.Send '销毁对象实例,释放内存 Set myMail = Nothing Response.write "發送成功" %>
2.Persits.MailSender 在线发邮件 程序代码: <% Set Mail = Server.CreateObject("Persits.MailSender") Mail.CharSet="gb2312" '定义编码 Mail.Host = "mail.gz7.cn" '填写你的邮件服务器地址 Mail.From = "xy@gz7.cn" '发件人的邮箱 Mail.FromName = "黑夜" ‘发件人姓名 Mail.AddAddress “xy@gz7.cn” '收件人邮箱 Mail.AddReplyTo "" Mail.IsHTML=False Mail.Subject = “标题” ‘邮件标题 Mail.Body = "内容" '邮件内容 Mail.Send set Send=nothing Response.write "發送成功" %> 3.JMail.SmtpMail 在线发邮件(JMail) 邮件可以使用HTML代码 程序代码: <% cname="黑夜" cemail="flash165@126.com" emailtitle="邮件可以使用HTML代码" emailcontant="<b>测试</b>" Set JMail = Server.CreateObject("JMail.Message")
JMail.ISOEncodeHeaders = True JMail.Silent = True JMail.Charset = "gb2312" JMail.From = "xy@gz7.cn" ' 发送者地址 JMail.FromName = "黑夜" ' 发送者姓名 JMail.MailServerUserName = "xy@gz7.cn" ' 身份验证的用户名 JMail.MailServerPassword = "*****" ' 身份验证的密码
JMail.AddRecipient cemail, cname JMail.Subject = emailtitle JMail.Body = emailcontant
JMail.HTMLBody = "<html><body><br>"&emailcontant JMail.appendHTML "<br><br></body></html>"
JMail.Body = "Too bad you can't read HTML-mail." JMail.appendText " "
if JMail.Send( "mail.gz7.cn" ) then '执行邮件发送(通过邮件服务器地址)smtp.域名.com 不一定是邮件服务器 response.Write("邮件发送成功") else response.Write("邮件发送失败") end if JMail.Close() Set JMail = Nothing %> |