Send Email in Classic ASP

Use the below code to send the email form classic ASP, you have to change the to and from address. You can also select either you want to send email in HTML format at or in simple textual.


   Set ObjSendMail = Server.CreateObject("CDO.Message")
            Set iConf = CreateObject("CDO.Configuration")
            Set Flds = iConf.Fields
            Flds("") = 1
            '**** Path below may need to be changed if it is not correct
            Flds("") = "c:\inetpub\mailroot\pickup"
            Set ObjSendMail.Configuration = iConf
            ObjSendMail.To = email
            ObjSendMail.Subject = txtSubject
            ObjSendMail.From = ""
            ' we are sending a text email.. simply switch the comments around to send an html email instead
            'ObjSendMail.HTMLBody = "this is the test email from"
            ObjSendMail.TextBody = txtBody
            if(len(email)>0) then
            end if
            set ObjSendMail=nothing                                       

Related Alrticles

Add Your Business in Free Listing

FREE!!! Registration