01/10/2008

Send Mail From ASP ( Use this Code)



Put the following code into your function :

            set cdoMessage = Server.CreateObject("CDO.Message")
            set cdoConfig = Server.CreateObject("CDO.Configuration")
         
          cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="127.0.0.1"
          cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
          cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 
            cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2         
           
            cdoConfig.Fields.Update
            set cdoMessage.Configuration = cdoConfig
            cdoMessage.From =  fromAddr
            cdoMessage.To = recipients
            cdoMessage.Subject = subject
            cdoMessage.HtmlBody = body
            on error resume next
            cdoMessage.Send
            if Err.Number < > 0 then
                SendMail = "Email send failed: " & Err.Description & "."
            end if
            set cdoMessage = Nothing
            set cdoConfig = Nothing


Categories: ASP
posted by Maulik Patel at 10:00 AM | Back to main page

Leave a Comment

About Me

Maulik Patel
View my complete profile

Friends

Paryank Kansara
woody
Administrator
Nirav Sheth

Links

Know about 14 Gaam
Download Shortkey
Orthotics Management system

Categories

Uncategorized
product
FAQ ASP.NET-C#.NET
Written Test Questions C#.net,asp.net
ASP.NET Interview Questions
General
Short Descriptive Que-Ans
Quiz
C# Interview Questions
New Features ASP.NET C#.NET
Share Points
ASP
ASP.NET
Localization

Archives

April, 2007
August, 2007
December, 2007
February, 2007
February, 2008
January, 2008
July, 2007
June, 2007
June, 2008
March, 2007
November, 2007
October, 2007

RSS Feed