Sunday 3 February 2013

Email Sending in asp using Cdosys component in windows 2008 Server and IIS7

Email Sending in asp using Cdosys component in windows 2008 Server and IIS7
-------------------------------------------------------------------------------------------------------------------------

Generally Every developer uses the following code

dim oMail, oMailConfig
Set oMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update
Set oMail.Configuration = oMailConfig
oMail.From = "youremailid"
oMail.To = "toemailid"
oMail.Subject = "testing subject"
oMail.HTMLBody = "testing html body"
oMail.Send
set oMail=nothing

What is SMTP Server name
1) localhost
2) computername
3) smtp.servername.com

What is SMTP Server Port
1) 25

What is send using
1) 1=email sending using pickup directory
2) 2=email sending over the network

What is SMTP Use SSL
1)smtpusessl=true
2)smtpusessl=false

What is SMTP Authentication
1)If no value is set for this field, anonymous (no authentication) is assumed.
2) Authentication=1 (Then Authentication is required)

No comments:

Post a Comment