Articles   Dev Forums   Personalize   Favorites   Member Login   ASP Hosting      Active Users:  208
DevASP - ASP and XML Articles, Samples, Toturials, Sample Chapters and resources for Developers Wednesday, May 14, 2008
Home
Articles & Samples
ASP Hosting
Dev Search
Dev Forum
Add Your Articles
Add a Listing
Sample Chapters
Directory Feed
Link to US
Contact

Search Directory
Applications
Articles & Samples
Components
Community
Database
Developer Sites
Downloads
Hosting Services
Introduction
Knowledge Base
Sample Chapters
WebCasts

ESET
ASP Directory
Applications
Articles & Samples
Components
Developer Sites
Knowledge Base
Sample Chapters
WebCasts
XML Directory
Applications
Articles & Samples
Developer Sites
Error, Bugs & Fixes
Downloads
Introduction
Knowledge Base
Sample Chapters
WebCasts


Setting the Reply-To Header in an Email using CDONTS.NewMail Object

This Sample Code will help you to understand how you can set the Reply-To header of an email message using the CDONTS.NewMail object in an ASP Page.




<%
Option Explicit

Dim objMail
Dim strSubject
Dim strBody

strSubject = "This is a test email"
strBody    = "This test email is using test@devasp.com " & _
           " as the sender email address but we are " & _
           " using someone@devasp.com as the Reply-To header."

     
' First create an instance of NewMail Object
Set objMail = Server.CreateObject("CDONTS.NewMail")

' Please replace the "From" and "To" email addresses with your
' own valid email address. I recieve too many emails
' from people who test this sample and keep sending
' emails to test@devasp.com, or they keep the "From" property
' as webmaster@devasp.com and I get response of
' undeliverable emails.
' NOTE: If the "To" or "From" properties of CDONTS contain
' invalid email address you will not recieve the email.
 
objMail.From = "test@devasp.com"
objMail.To   = "webmaster@devasp.com"

' Use the value property of the CDONTS.NewMail Object
' to Set the Reply-To header

objMail.Value("Reply-To") = "someone@devasp.com"

objMail.Subject = strSubject
objMail.Body    = strBody

objMail.Send

Set objMail = Nothing
%>

Have Questions? Discuss this topic in Dev Forum


Related Articles

   Sending Mail with CDONTS.NewMail Object

   Sending Email in HTML format using CDONTS.NewMail Object

DevASP - Privacy - Disclaimer
Copyright © 2008 DevASP.com