ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 22nd, 2003, 09:03 AM
yessir's Avatar
yessir yessir is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 266 yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 4 h 21 m 15 sec
Reputation Power: 10
Question email script and application thereof...

CDONTS and me...
I went searching this site and the web and finally came across some documentation pertaining to the use of CDONTS that was more then asking how to use them...

The useful ones must be deleted from here or i am using the wrong search keywords...

anyway, i found this code as part of the MS documentation and as i do not enjoy MS or rely on their ability to be right, i bring it to you, the professionals for critique...

Please let me know if the functionality is good, useable, needs improvement and where, it's mostly documentation so not a lot to read..

Thanks!
~



code:----------------------------------------------------------

'=============================================
' Send the results to e-mail.
' Use CDONTS to create and send a message based on information
' entered into the form. The following lines compose and send
' the e-mail.
'=============================================

'=============================================
' Set up variables:
' myCDONTSMail = A CDONTS mail object.
' strFrom = A string containing the source e-mail address.
' strTo = A string containing the destination e-mail address.
' strSubject = A string containing the subject of the e-mail.
' strBody = A string containing the body of the e-mail.
'=============================================
Dim myCDONTSMail
Dim strFrom
Dim strTo
Dim strSubject
Dim strBody

'%%%%%%%%%%%%%%%%%%%%%%%%%%%
' Assign the source e-mail address. Change this to your e-mail address.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strFrom="example@microsoft.com"

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' Assign the destination e-mail address. In this example, get the
' e-mail address from the form field called "EMail".
' You can customize this by removing the EMail form field and
' changing the following line to this:
' strTo="example@microsoft.com" ß Change this to your e-mail
' address.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strTo=Request.Form("EMail")

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following line is the subject of the e-mail. You can change
' this to a subject that is customized to your liking.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strSubject = "Send to E-mail and Database"

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following lines create the body of the message. This can be
' anything you want it to be.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strBody="The following information was submitted:" & Chr(13)
strBody = strBody & Request.Form("FirstName") & " "
strBody = strBody & Request.Form("LastName")
strBody = strBody & Chr(13) & Request.Form("Address") & Chr(13)
strBody = strBody & Request.Form("City") & Chr(13)
strBody = strBody & Request.Form("Region") & Chr(13)
strBody = strBody & Request.Form("PostalCode") & Chr(13)
strBody = strBody & Chr(13) & "Thank you for submitting your data."

'=============================================
' The SET statement creates the CDONTS mail object in preparation
' for sending the e-mail message.
'=============================================
Set myCDONTSMail = CreateObject("CDONTS.NewMail")

'=============================================
' The following line sends the mail message using the source e-mail,
' destination e-mail, subject, and body that were defined earlier.
'=============================================
myCDONTSMail.Send strFrom,strTo,strSubject,strBody

'=== Set the CDONTS mail object to NOTHING to free resources.
Set myCDONTSMail = Nothing


'%%%%%%%%%%%%%%%%%%%%%%%%%%%
' For information about how to customize the rest of this page, see the
' Customizing the Confirmation Page section of this document. Sections
‘ that are discussed in the Customizations section are delimited
' by percent signs.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%>

< /head>

< body bgcolor="#FFCC99">

< p>< font face="Verdana" color="#FF0000">< b>Thank you for submitting your
information!< br>
< /b>< /font>< font face="Verdana" size="2">You will receive an e-mail
shortly. The e-mail was sent using the following information:< /font>< /p>
< b>< b>< font face="Verdana" size="2">Sent To:
< br>
From : Microsoft PSS Sample Page< /font>< /b>< /p>
< p>< b>< font face="Verdana" size="2">Subject: Send to Database and E-mail< /font>< /b>< /p>
< p>< b>< font face="Verdana" size="2">Content:
< % '%%%%%%%%%%%%%%%%%%%%%%%%%%
' Call the ParseBody function and pass the strBody string to it.
' This will replace the Chr(13) characters with tags in the HTML.
Response.Write(ParseBody(strBody))
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%>
< /font>< /b>< /p>
< hr noshade size="1" style="color: #000000">
< p> < /p>

< /body>

< /html>


---------------------------------------------------------------------
Also,

How do I connect the script to the add button AFTER the form validation is done...



code:----------------------------------------------------------------
< form name="EW_this" onSubmit="return EW_checkMyForm(this);" action="tab_CTS_informationadd.asp" method="post">
< input type="hidden" name="a" value="A">
< input type="submit" name="Action" value="ADD">
< /form>

---------------------------------------------------------------------

Reply With Quote
  #2  
Old October 22nd, 2003, 05:00 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 13 m 21 sec
Reputation Power: 76
Its a functional CDONTS script... However, CDONTS is being depreciated, so you might want to just use CDO and the NewMail object.
As for connecting the script, not sure what you mean. Are you using Javascript or asp to validate your form? If javascript, you'll have your validation happen before the submit actually occurs, so there's no problem. If asp, you just do the validation first, and have it kick back the error if the validation fails, before the email is sent.
HTH

Reply With Quote
  #3  
Old October 23rd, 2003, 06:21 AM
yessir's Avatar
yessir yessir is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 266 yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 4 h 21 m 15 sec
Reputation Power: 10
Question

Do you mean use:

Code:
Set myCDOMail = CreateObject("CDO.NewMail") 


Instead of this:

Code:
Set myCDONTSMail = CreateObject("CDONTS.NewMail") 


Is that the ONLY change for CDO?

Reply With Quote
  #4  
Old October 23rd, 2003, 03:15 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 13 m 21 sec
Reputation Power: 76
yes

Reply With Quote
  #5  
Old October 24th, 2003, 06:16 AM
yessir's Avatar
yessir yessir is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 266 yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 4 h 21 m 15 sec
Reputation Power: 10
i just found out that the server uses jmail...

dimac no longer (since may 15 2002) provides a free version of jmail.

I am wondering where i can get an older version (4.1 or 4.2) and how to set it up porperly on a local host?

thanks
~

Reply With Quote
  #6  
Old October 24th, 2003, 09:17 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 13 m 21 sec
Reputation Power: 76
http://tech.dimac.net/
There is a free version of the jmail component on their site, with somewhat limited functionality, but it should be sufficient to see how it works. The manual is also online

Reply With Quote
  #7  
Old October 24th, 2003, 09:34 AM
yessir's Avatar
yessir yessir is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 266 yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level)yessir User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 4 h 21 m 15 sec
Reputation Power: 10
it's shareware

Reply With Quote
  #8  
Old October 26th, 2003, 01:12 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 13 m 21 sec
Reputation Power: 76
So? You just need to see how to set it up and test it a couple times, dont you? Then upload to the server and you're good. Its just a mail component, not too much to figure out.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > email script and application thereof...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT