Sending an email using Classic ASP and the CDOSYS component that comes preinstalled on all Windows servers and operating systems.
Important
WARNING!!!! This does not work with [Windows Core Servers].
[ASP.NET] email is the preferred method and what we use here.
First, we need our form. With a name, email, subject, and a message field.
[mailform.asp]
CFFCS | CarrzSynEdit: | HTML (Hyper Text Markup Language)
<form method="post" action="mail.asp">
<label>Name</label>
<div><input type="text" name="name" /></div>
<label>Email</label>
<div><input type="text" name="email" /></div>
<label>Subject</label>
<div><input type="text" name="subject" /></div>
<label>Message</label>
<div><textarea name="message" rows="5" cols="60">

Next, we need to process the form and send the message to the recipient (Most of the time, this is the webmaster or owner of the site).
[mail.asp]
CFFCS | CarrzSynEdit: | ASP/VBScript

<%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
      
'This section provides the configuration information for the remote SMTP server.

      
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yourserver.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
      
' If your server requires outgoing authentication, uncomment the lines below and use a valid email address and password.

'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication

'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com"

'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword"

      
ObjSendMail.Configuration.Fields.Update
      
'End remote SMTP server configuration section==

 
' gets the variables from the form to use in your mail

getName = request.form("name")
getEmail = request.form("email")
getSubject = request.form("subject")
getMessage = request.form("message")
      
ObjSendMail.To = "someone@someone.net" ' Put in the email address to which you want to send the message.

ObjSendMail.Subject = getSubject
ObjSendMail.From = getEmail &"("&getName&")"
      
'Now we are sending the email body.

ObjSendMail.HTMLBody = "This is the first line of your email"
ObjSendMail.HTMLBody = ObjSendMail.HTMLBody &"This is the second line of your email"
' Now to add your variables to your email body

ObjSendMail.HTMLBody = ObjSendMail.HTMLBody &"Message from: "&getName&"
 with email: "&getEmail&"
 with subject: "&getSubject&"
 With Message: 
"&getMessage&""

'ObjSendMail.TextBody = "this is the body"

 
' Now time to send the message.    

ObjSendMail.Send
      
Set ObjSendMail = Nothing
%>