[asp]jmail发送邮件
简单的SendMail函数:
'==============================
'FromMail 发件人邮箱
'FromName 发件人名称
'Subject 邮件主题
'UserName 发送邮件用户名
'Password 发送邮件密码
'ToMail 收件邮箱
'ServerName 发送服务器
'Body 发送邮件内容
'==============================
Function SendMail(FromMail,FromName,Subject,UserName,Password,MailTo,SmtpHost,Body)
On error resume next
Dim JMail
Set JMail= Server.CreateObject("JMail.Message")
JMail.Charset = "gb2312"
JMail.From = FromMail
JMail.FromName = FromName
JMail.Subject = Subject
JMail.MailServerUserName = UserName
JMail.MailServerPassword = Password
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.AddRecipient MailTo
JMail.Body = Body
JMail.Send(SmtpHost)
JMail.Close()
Set JMail= Nothing
End Function
'FromMail 发件人邮箱
'FromName 发件人名称
'Subject 邮件主题
'UserName 发送邮件用户名
'Password 发送邮件密码
'ToMail 收件邮箱
'ServerName 发送服务器
'Body 发送邮件内容
'==============================
Function SendMail(FromMail,FromName,Subject,UserName,Password,MailTo,SmtpHost,Body)
On error resume next
Dim JMail
Set JMail= Server.CreateObject("JMail.Message")
JMail.Charset = "gb2312"
JMail.From = FromMail
JMail.FromName = FromName
JMail.Subject = Subject
JMail.MailServerUserName = UserName
JMail.MailServerPassword = Password
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.AddRecipient MailTo
JMail.Body = Body
JMail.Send(SmtpHost)
JMail.Close()
Set JMail= Nothing
End Function