Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!


Sending Mail Using Classic ASP Persits AspEmail


Below you will find an example of sending email from your Web Wiz Hosted Website using Classic ASP and the Persits AspEmail component, connecting on port 587 with an encrypted TLS (STARTTLS) connection.

In order to send email you will first need to Setup a Mailbox from your Hosting Control Panel to use to send your email.

You would then enter the email address for your mailbox where it has "you@your-email-here.com" and the password where it has "YourPasswordHere" in the example below.

If you are sending email from a "Contact Us" form on your website you may wish to use the website visitor's address when replying to the email. For this you would set a "ReplyTo" address with the visitor's email address where you see "reply-to@your-email-here.com"


<%
'Create the e-mail server object
Set objAspEmail = Server.CreateObject("Persits.MailSender")

With objAspEmail

'Out going SMTP server
.Host = "smtp.websitelive.net"

'SMTP port
.Port = 587

'TLS Encryption (STARTTLS)
.TLS = True

'SMTP Server username
.Username = "you@your-email-here.com"

'SMTP Server password
.Password = "YourPasswordHere"

'Who the e-mail is from, this needs to be the same as your SMTP Server username
.From = "you@your-email-here.com"
.FromName = "Your Name Here"

'Who the e-mail is sent to
.AddAddress "to@to-email-here.com"

'Who to reply-to when replying to the email
.AddReplyTo "reply-to@your-email-here.com"

'Set the character set for the e-mail
.Charset = "utf-8"
.ContentTransferEncoding = "Quoted-Printable"

'The subject of the e-mail
.Subject = "Website Enquiry"

'Set the e-mail body format (True=HTML False=Plain)
.IsHTML = True

'The body of the e-mail
.Body = "this is the body"

'Send the e-mail
.Send

End With

'Close the server mail object
Set objAspEmail = Nothing
%>


Back To Hosting Knowledgebase Menu

Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz® is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, €, prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz® Ltd. All rights reserved.