现在大多免费邮箱的smtp都不能使用了
sohu好像还可以 老的163邮箱也可以(新申请的不行了)
首先确定你的服务器上正确安装了jmail组件
然后确定你服务器上是否杀毒软件或防火墙拦截25号端口以及拦截发邮件的程序等比如麦咖啡默认就会拦截
第三确定你的邮箱支持smtp登陆 比如新申请的163好像就不能登陆,其他常用免费邮箱好像都不怎么支持了,可以试试搜狐邮箱以及qq邮箱 2010年4月试qq邮箱可以用,但需要在qq邮箱内开启smtp功能
<%
Function Send_Email(smtpHost,smtpUser,smtpPass,mailTo,FromName,subject,content)
on error resume next
Set jmail = Server.CreateObject("JMAIL.Message")
jmail.silent = true
jmail.logging = true
jmail.Charset = "gb2312"
jmail.ContentType = "text/html"
jmail.AddRecipient mailTo
jmail.From = smtpUser
jmail.FromName = FromName
jmail.Subject = subject
jmail.Body = content
jmail.Priority = 1
jmail.Silent = False
jmail.Logging = True
jmail.MailServerUserName = smtpUser
jmail.MailServerPassword = smtpPass
jmail.Send(smtpHost)
jmail.Close()
response.Write err.description
End Function
%>