Asp 使用 w3 JMail 组件发送邮件代码:

<%
Function SendMail(MAddress, MTitle, MContent)
'使用格式:收件地址,邮件标题,邮件内容
Dim MUsername, MPassword, MaiServer
MUsername = "hello@163.com"     '发件账号
MPassword = "0123456789"        '账号密码
MaiServer = "smtp.163.com"      '发件服务器
Set Jmail = Server.CreateObject("JMAIL.Message")  '建立发送邮件的对象
Jmail.Silent = true                               '屏蔽例外错误,返回的值为False、True
Jmail.Logging = true                              '启用使用日志
Jmail.Charset = "GB2312"                          '文字编码:简体中文
Jmail.ContentType = "text/html"                   '邮件格式:Html
Jmail.Priority = 1                                '邮件的优先级[1-5(高-低),默认:3]
Jmail.Subject = MTitle                            '邮件标题
Jmail.Body = MContent                             '邮件内容
Jmail.AddRecipient MAddress                       '收件人地址
Jmail.From = MUsername                            '发件人地址
Jmail.FromName = MUsername                        '发件人姓名
jmail.MailServerUserName = MUsername              '邮件用户名
Jmail.MailServerPassWord = MPassword              '邮件用户密码
jmail.Send(MaiServer)                             '通过邮件服务器发送
Jmail.Close                                       '关闭对象
End Function
SendMail "hello@qq.com", "Hello, World!", "这是一封测试邮件!"
%>