DotNetted - Windows hosting specialists
 
 
   
General Support
Domain Names
Default Documents
SSL Shared Cert
ASP 500 error message
Pre-installed Files
Publishing Your Site
Uploading with FTP
FrontPage/Visual Studio
Using DreamWeaver
E-Mail
Greylisting (important)
Setup pop3 and smtp
Using webmail
E-mail administration
Configure spam filters
Databases
Access Database
SQL Server 2005
SQL Server 2000
Scripting
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 : www.AspEmail.com

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 = "me@mysite.co.uk"

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

' 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 = "me@mysite.co.uk"
Mail.Password = "password"

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

' 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').

Notes

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

reliability and security
separate application for each site
unique 'sandboxed' user per site
windows 2008 / IIS 7 web hosting
windows 2003 / IIS 6 web hosting
virus / spam protection
all incoming e-mail virus checked
fully configurable spam filtering
scripting support
full support - asp.net version 1.1
full support - asp.net version 2.0
full support - asp.net version 3.0
full support - asp.net version 3.5
full support - asp.net version 4.0
full support - asp 'classic' 3.0
quality asp components installed
complete e-mail service
pop3 and smtp e-mail services
industry leading webmail interface
web based administration interface
development software
compatible with dreamweaver
compatible with visual studio .net
compatible with MS frontpage
database support
MS access databases included
sql server 2000 database £6 mth
sql server 2005 database £6 mth
statistics reporting
comprehensive web based stats
pre-defined or custom stats reports
optional SSL support
shared SSL access just £1 / month
your own SSL cert just £5 / month
 
Copyright © DotNetted - All Rights Reserved Prices are subject to VAT @ 17.5%