Jmail邮件发送的函数:
<% Function Send_Email(smtpHost,smtpUser,smtpPass,mailTo,FromName,subject,content) 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.MailServerUserName = smtpUser jmail.MailServerPassword = smtpPass jmail.Send(smtpHost) jmail.Close() response.write("邮件发送成功") End Function %>
其中: Send_Email表示自定义的函数名称 smtpHost表示邮件服务器地址 smtpUser表示发信验证所需的登录帐户 smtpPass表示发信验证所需的登录密码 mailTo表示邮件收件人的E-Mail地址 FromName表示邮件发件人的名称 subject和content则分别表示邮件的标题和正文内容
通过如下方法可应用该函数: Call Send_EMail("smtp.126.com","dw8asp@126.com","******","cnbruce@msn.com","cnbruce","标题","邮件正文内容") 或者有个人邮局的可使用 Call Send_EMail("mail.cnbruce.com","root@cnbruce.com","******","cnbruce@msn.com","cnbruce","标题","邮件正文内容") |