Initiate Live Support Contact Numbers Raise a Support Ticket
Hosting Technical Support Options
dotnetted - the hosting specialists
the hosting specialists
no part of
order .net hosting .net hosting packages frequently asked questions technical support hosting terms / aup contact dotnetted
half price .net web hosting
half price .net 4.0 hosting
99.99% uptime DreamWeaver
UK based servers Visual Studio .Net
UK bandwidth Classic ASP
ASP.NET 1.1 - 4.5 SQL Server
IIS 7 or IIS 8 Application isolation
  Technical Support
General Support
Domain Names
Default Documents
SSL Shared Cert
ASP 500 error message
Pre-installed Files
Changing .Net version
Publishing Your Site
Uploading with FTP
FrontPage/Visual Studio
Using DreamWeaver
Greylisting (important)
Setup pop3 and smtp
Using webmail
E-mail administration
Configure spam filters
Access Database
SQL Server
ASP Mail Script
ASP Form To E-Mail
ASP Send Secure E-Mail
Other ASP Components
Session State for .NET
Send mail with .NET 1.1
Send mail with .NET 2+
Upload file using .NET
Contact tech support

Script to send mail using ASP

All outgoing mail sent from DotNetted customer sites must be routed through our mailserver using authentication to provide additional security and guard against abuse - for this reason the SMTP service is not installed on our web servers so CDONTS and CDOSYS are not available to your .asp scripts for sending mail.

Instead we provide the very popular and reliable AspEmail component from Persits to enable you to send mail from your ASP scripts. AspEmail is totally reliable, offers many additional features over CDO and typically uses a lot less code to do the same job.

Full information on AspEmail as well as many sample scripts and the full object reference can be found on the authors web site :

Simple ASP Script to send mail using AspEmail

The following is a very basic script to send a mail from an .asp page (we will build on this mail in the next scripting example to retrieve and e-mail information from a form). Note that lines starting ' are explanatory only - these lines are not parsed by the server.


' First Step is to create the AspEmail message object
Set Mail = Server.CreateObject("Persits.MailSender")

' Set the from address - replace value within the quotes with your own
Mail.From = ""

' Add the e-mail recipient address - again replace value within the quotes with your own
Mail.AddAddress ""

' Set the subject for the e-mail
Mail.Subject = "Test mail via AspEmail"

' Create the body text for the e-mail
Mail.Body = "This mail was sent via AspEmail"

' The mail server requires that we authenticate so supply username and password
Mail.Username = ""
Mail.Password = "password"

' The e-mail is now ready to go, we just need to specify the server and send
Mail.Host = ""

' Mail is sent - tidy up and delete the AspEmail message object
Set Mail = Nothing


That's it - you just need to substitute your own values where required and you should be able to copy this script to your account and send your first e-mail.

Note that as we use authentication the 'Mail.From' e-mail address must be a live user on our mailserver and should match the address used for the 'Mail.Username'.


This is a very basic script, for more information and the additional options available within AspEmail please visit the authors web site :

order hosting   hosting packages   frequently asked questions   technical support   terms and conditions   contact dotnetted
Copyright © DotNetted - All Rights Reserved Prices are subject to VAT @ 20%