📄 b2b_mail.asp
字号:
<%
Sub sendemail(sendFrom,sendTO,smtpserver,sendusername,sendpassword,subject,message)
On Error Resume Next
set iConfg = CreateObject("CDO.Configuration")
Set oFields = iConfg.Fields
'oFields = iConfg.Fields
oFields.item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
oFields.item("http://schemas.microsoft.com/cdo/configuration/sendemailaddress")=sendFrom //sender mail
oFields.item("http://schemas.microsoft.com/cdo/configuration/smtpaccountname")=sendFrom //email account
oFields.item("http://schemas.microsoft.com/cdo/configuration/sendusername")=sendusername
oFields.item("http://schemas.microsoft.com/cdo/configuration/sendpassword")=sendpassword
oFields.item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1
oFields.item("http://schemas.microsoft.com/cdo/configuration/languagecode")=&H0804
oFields.item("http://schemas.microsoft.com/cdo/configuration/smtpserver")=smtpserver
oFields.Update()
Set oMsg = Server.CreateObject("CDO.Message")
Set oMsg.Configuration = iConfg
oMsg.From = sendFrom
oMsg.To = sendTO
oMsg.Subject = subject
oMsg.HTMLBody = message
oMsg.Send()
if err.number<>0 then
Response.write "<center>邮件发送失败,请与管理员联系!</center>"
end if
Set MailObject = Server.CreateObject("CDONTS.NewMail")
MailObject.Send smtpmail,mailaddress,mailtopic,body
Set MailObject=nothing
End Sub
Sub SendJmail(sendFrom,sendTO,smtpserver,sendusername,sendpassword,subject,message,SendName)
On Error Resume Next
Set JMail=Server.CreateObject("JMail.Message")
JMail.Charset="gb2312"
JMail.ContentType = "text/html"
jmail.from = SendFrom
jmail.silent = true
jmail.Logging = true
jmail.FromName = SendName
jmail.mailserverusername = sendusername
jmail.mailserverpassword = sendpassword
jmail.AddRecipient sendTO
jmail.body=message
JMail.Subject=subject
if not jmail.Send ( smtpserver ) then
SendMail="<center>由于系统错误,给您发送的操作记录未成功!</center>"
end if
response.Write SendMail
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -