Home Hosting Domains IT Services Support Contact Us
MyAccount PortalClient AreaAnnouncementsKnowledgebaseSupport TicketsDownloads

Knowledgebase
You are here: MyAccount Portal > Knowledgebase > Web Development & Coding > How do I send email with ASP?

How do I send email with ASP?

You can use AspEmail to send email from your website.

Place the following code into your asp page to send an email.

Preferred AspEmail Code Sample:

<%
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "localhost" ' Specify a valid SMTP server
Mail.From = "sales@veryhotcakes.com" ' Specify sender's address
Mail.FromName = "VeryHotCakes Sales" ' Specify sender's name

Mail.AddAddress "andy@andrewscompany.net", "Andrew Johnson, Jr."
Mail.AddAddress "paul@paulscompany.com" ' Name is optional
Mail.AddReplyTo "info@veryhotcakes.com"
Mail.AddAttachment "c:\images\cakes.gif"

Mail.Subject = "Thanks for ordering our hot cakes!"
Mail.Body = "Dear Sir:" & Chr(13) & Chr(10) & _
"Thank you for your business."

On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "Error encountered: " & Err.Description
End If
%>



Was this answer helpful?

Add to Favourites
Print this Article

Also Read
Relative Path URL's (Views: 352)


Network Status Client Area Knowledgebase Datacentre  
 
Terms of ServicePrivacy PolicyCustomer Security