1. Home
  2. Windows
  3. Send email via classic asp

Send email via classic asp

To send emails with ASP.NET, check out this guide, where we show you how to do it.

If you want to use classic ASP instead, you can send e-mail through CDOSYS (we do not support Jmail). The example below shows how to send a message through Websupport’s email servers.

<% Set msg = CreateObject("CDO.Message") 
msg.Subject = "This is the subject" 
msg.From = "from@example.com" 
msg.To = "to@example.se" 
msg.TextBody = "This is the message." 
Const CDOSchema = "http://schemas.microsoft.com/cdo/configuration/" 
With msg.Configuration.Fields 
.Item(CDOSchema & "sendusing") = 2 
.Item(CDOSchema & "smtpserver") = "smtp.websupport.se" 
.Item(CDOSchema & "smtpserverport") = 587 
.Item(CDOSchema & "smtpauthenticate") = 1 
.Item(CDOSchema & "sendusername") = "from@example.com" 
.Item(CDOSchema & "sendpassword") = "Mail account password" 
.Update 
End With 
msg.Send 
set msg = nothing 
%>
Updated on 25. March 2024
Was this article helpful?

Related Articles