Join us on Facebook!
14
Jun

Sending mail in asp

by admin 1457 views 0 Comments and 0 Rections

Sending mail in asp through CDO is pretty simple. There are only few things to configure and you are ready to go! Here is the code for sending mail:


<%
Set ObjSendMail = CreateObject("CDO.Message")

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mailServer
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = username
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = password

ObjSendMail.Configuration.Fields.Update

ObjSendMail.To = toEmail
ObjSendMail.Subject = subJect
ObjSendMail.From = fromEmail

ObjSendMail.HTMLBody = Message


ObjSendMail.Send
Set ObjSendMail = Nothing
%>

mailServer: enter your mail server (smtp) address here. e.g: smtp.myserver.com.
username: your username/email address on that server.
password
: your password on that server.
toEmail: the email address to which you are sending mail.
subJect: subject of the email.
fromEmail: the email which the receiver will see in from field.
Message: message body of the email (can be html).

So thats all! Just configure these fields on you are ready to go!

More Posts in "Tutorials"

Comments

blog comments powered by Disqus

Feed Subscription

Get daily inboxed with latest news, reviews and tutorials. Signup now it's free :)



Planetmaks on Twitter

Follow PlanetMaks on Facebook

Recent Comments

Powered by Disqus

Tags

32Bit 64Bit 7 Admin Tool Admin Tools Admin-Tool Admin-Tools AdminTool Adobe Adware All-in-One Anti-Spyware Anti-Virus Apple Backup Tools Browser Browsers Changing Default Directory Codec Data Recovery Download Manager Downloads Drive Utilities Driver Drivers Firefox Flash Freeware Google Graphics Internet Tool Internet-Tool Messaging Microsoft Microsoft Tool Micsellonous Monitoring Multimedia Networking News NVidia Office Tool Office-Tool PC Suite Press Release Registry Samsung Security Shareware Software Softwares Tutorials Vista Windows Windows 7 Windows 8