这是我在经典 ASP 中的代码,它可以完全正常工作,但是此代码发送的邮件进入垃圾邮件而不是收件箱。那么如何在收件箱中发送邮件?
Dim iMsg
Dim iConf
Dim Flds
Dim smtpServer
Dim smtpServerPort
Set iMsg = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
set iMsg.Configuration=iConf
With Flds
smtpServer = "127.0.0.1"
If Len(smtpServer) > 0 Then
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
smtpServerPort = 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = smtpServerPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\inetpub\mailroot\Pickup"
.Item("urn:schemas:mailheader:X-Priority") = 2 '*** 0=Low,1=Normal,2=High ***'
.Item("urn:schemas:mailheader:X-MSMail-Priority") = 2
.Item("urn:schemas:httpmail:importance") = "High"
End If
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.update
End With
' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.From = sFrom
.To = sTo
.TextBody="This is a message."
.Subject = sSubject
end with
iMsg.Send
set iMsg = nothing`
我的代码完全正常。但是这封邮件进入垃圾邮件而不是收件箱。那么,我怎样才能在收件箱中发送邮件?