How to send email from classic asp / CDOSYS /

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message") 

'This section provides the configuration information for the remote SMTP server.

ObjSendMail.Configuration.Fields.Item ("") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("") =""
ObjSendMail.Configuration.Fields.Item ("") = 25 
ObjSendMail.Configuration.Fields.Item ("") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("") = 60

' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
'ObjSendMail.Configuration.Fields.Item ("") = 1 'basic (clear-text) authentication
'ObjSendMail.Configuration.Fields.Item ("") =""
'ObjSendMail.Configuration.Fields.Item ("") ="yourpassword"
' replace  with a real email account that you created in websitepanel 

'End remote SMTP server configuration section==

ObjSendMail.To = ""
ObjSendMail.Subject = "this is the subject"
ObjSendMail.From = ""

' we are sending a text email.. simply switch the comments around to send an html email instead
'ObjSendMail.HTMLBody = "this is the body"
ObjSendMail.TextBody = "this is the body"


Set ObjSendMail = Nothing 

Carbon Copy
ObjSendMail.CC = ""

Blind Carbon Copy
ObjSendMail.BCC = ""

Send Attachment (we hard code it here, but you could specify the file path using Server.Mappath as well)
.AddAttachment "c:\myweb\somefile.jpg"

Was this answer helpful?

 Print this Article

Also Read

I get error when conneting to MS SQL 2008 server

If you get this error: The server principal " " is not able to access the database " " under the...

How to send email from your code?

' Visual Basic Sample - Sending SMTP Authenticated E-mail ' Please replace in...

Conection String to MS SQL 2008 DB - example

In order to connect to SQL Server 2008 from Management Studio, Enterprise Manager, Query...

MS SQL 2008 and MySQL server addresses

MSSQL 2008 server addresses are:

How to enable remote IIS management for my site?

Login to your hosting control panel here then click on Web - Web...