This is my code in classic ASP, and it works completely, but mail sent by this code is sent to the Spam folder instead of Inbox. What to do to send mail to inbox?
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`
My Code Works Completely.But This mail goes to spam instead of Inbox. So how can I send mail to Inbox?
source share