<%Dim SendMsg,MsgValue,cdoConfig:Function SendMail(str1,str2,str3):Select Case SendObject:Case 0:SendMail="False":Case 1:Jmail str1,str2,str3:Case 2:Cdonts str1,str2,str3:Case 3:aspemail str1,str2,str3:Case 4:CDOMessage str1,str2,str3:End Select
If SendMsg=False Then
SendMail=False
Else:SendMail=SendMsg
End If:End Function:Sub Jmail(email,topic,mailbody):Dim JMail:err.clear:Set JMail=Server.CreateObject("JMail.Message")
If Err<>0 Then
MsgValue="服务器不支持Jamil组件":ShowErr(MsgValue):SendMsg="False":exit Sub
End If:JMail.silent=True:JMail.Logging=True:JMail.Charset="gb2312":jmail.ISOEncodeHeaders=True:jmail.MailServerUserName=web_JMailMailServerUserName:jmail.MailServerPassWord=web_JMailMailServerPassword:jmail.From=web_JMailFrom:jmail.FromName=FromName:jmail.AddRecipient (Email):jmail.Subject=Topic:jmail.Body=Mailbody:jmail.AddHeader "Priority", "3":jmail.AddHeader "MSMail-Priority", "Normal":jmail.AddHeader "Mailer", "Microsoft Outlook Express 6.00.2800.1437":jmail.AddHeader "MimeOLE", "Produced By Microsoft MimeOLE V6.00.2800.1441"
If Err <> 0 Then
SendMsg="False"
Else:JMail.Send (web_JmailSmtp) :JMail.ClearRecipients()
If Err <> 0 Then
SendMsg=False':domakestill?inhow:::#\manycould'they:`these
Else:SendMsg=True
End If
End If:Set JMail=nothing:End Sub:Sub Cdonts(email,topic,mailbody):Dim objCDOMail:Err.clear:Set objCDOMail=Server.CreateObject("CDONTS.NewMail")
If Err<>0 Then
MsgValue="服务器不支持Cdonts组件":ShowErr(MsgValue):SendMsg="False":exit Sub
End If:objCDOMail.From=FromName:objCDOMail.To=email:objCDOMail.Subject=topic:objCDOMail.BodyFormat=0:objCDOMail.MailFormat=0:objCDOMail.Body=mailbody':':take:gothad:'but:an:beingthan]that::
If Err <> 0 Then
SendMsg="False"
Else:objCDOMail.Send
If Err <> 0 Then
SendMsg=False
Else:SendMsg=True'*:about:)all{from~"`}come:thisarebeing:'
End If
End If:Set objCDOMail=Nothing:End Sub:Sub aspemail(email,topic,mailbody):Dim Mailer:err.clear:Set Mailer=Server.CreateObject("Persits.MailSender")
If Err<>0 Then
MsgValue="服务器不支持Aspemail组件":ShowErr(MsgValue):SendMsg="False":exit Sub
End If:Mailer.Charset="gb2312":Mailer.IsHTML=True:Mailer.username=JMailMailServerUserName :Mailer.password=JMailMailServerPassword :Mailer.Priority=1:Mailer.Host=SMTP:Mailer.From=JMailFrom :Mailer.FromName=FromName :Mailer.AddAddress email,email:Mailer.Subject=topic:Mailer.Body=mailbody
If Err <> 0 Then'herotherfor"::::then::are::':::another
SendMsg="False"
Else:Mailer.Send
If Err <> 0 Then
SendMsg=False
Else:SendMsg=True
End If':hasdo":.":'been::~!alsohadsuch"on
End If:Set Mailer=Nothing:End Sub:Sub CDOMessage(Email,Topic,Mailbody):Dim obj:Dim iConf:Dim Flds:Dim strHTML:Const cdoSendUsingPort=2:Const sch="http://schemas.microsoft.com/cdo/configuration/":set obj=CreateObject("CDO.Message"):set iConf=CreateObject("CDO.Configuration"):iConf.Fields.Item(sch & "smtpserver")=web_JmailSmtp :iConf.Fields.Item(sch & "sendusing")=2:iConf.Fields.Item(sch & "smtpaccountname")=FromName:iConf.Fields.Item(sch & "sendemailaddress")=web_JMailFrom:iConf.Fields.Item(sch & "smtpuserreplyemailaddress")=25:iConf.Fields.Item(sch & "sendusername")=web_JMailMailServerUserName:iConf.Fields.Item(sch & "sendpassword")=web_JMailMailServerPassword:iConf.Fields.update:Set obj.Configuration=iConf:Obj.To=Email:Obj.Subject=Topic:Obj.TextBody=Mailbody:Obj.Send:Set obj=Nothing:Set iConf=Nothing:Set Flds=Nothing:End Sub
%> 