a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Results to DB and Email-- REVISITED !

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Results to DB and Email-- REVISITED !
Page: [1]
 
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
Results to DB and Email-- REVISITED ! - 8/25/2005 9:52:21   
I have seen so much about emailing results and results to database AND emailing. I am getting dizzy !!! :) Most of it is over my head.

I am trying to send my results from a form to database and email at the same time. I have no problem sending to database. Also, no problem sending to email but can only do one at a time.

I am running a Windows 2003 Web Server. Everything is working great.

I tested my SMTP via telnet and was able to send myself an email through port 25.

Here's my plea for help:

Is there some kind of simple (because I am) way/script, etc that I can use to email the results of a form while at the same time continuing to post to a database ? I have seen some stuff on this site but don't seem to be able to locate the scripts again. I don't have any money to spend on any third party programs so it is just a "script and I" type of thing.

I would REALLY appreciate any help. This is the last task for an online maintenance request web site with multiple pages depending on the type of maint. for our Fire Department before I go live with it.

Thank you, Thank you, Thank you.

Mike

< Message edited by mtee55 -- 8/25/2005 13:03:58 >
BeTheBall

 

Posts: 6385
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/25/2005 10:57:53   
What script did you use to send the test email? What about your database insert, are you using pure ASP or Frontpage?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/25/2005 11:28:55   
I used Microsoft's article KB323350 to test SMTP services manually in Windows Server 2003. You actually telnet into the server and open port 25 and send an email.

I am using Frontpage 2003 and creating asp forms in it.

Thanks,

Mike

(in reply to BeTheBall)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/25/2005 15:16:08   
Continuing to tinker.... I have been able to send email from an .asp page using CDOSYS and the following script:

<%
Dim sMsg
Dim sTo
Dim sFrom
Dim sSubject
Dim sTextBody

sTo = "myname@mymail.org"
sFrom = "Email@mymail.web01.org"
sSubject = "Web Page Send"
sTextBody = "Test from testemail.asp"

Dim objMail
'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")

'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject= sSubject
objMail.TextBody = sTextBody

'Send the email
objMail.Send

'Clean-up mail object
Set objMail = Nothing
%>

I just need to figure out how to send results from a form submit now. Thanks anyone.

Mike

(in reply to mtee55)
Spooky

 

Posts: 26618
Joined: 11/11/1998
From: Middle Earth
Status: online

 
RE: Results to DB and Email-- REVISITED ! - 8/25/2005 16:11:35   
If you post a form from page 1 to page 2 (that contains the asp script) it would look something like this :

Page1.asp
<form method=post action=page2.asp>
<textarea name=body></textarea>
<input type=text name=emailto>
<input type=submit>
</form> 


Page2.asp
 <%
Dim sMsg
Dim sTo
Dim sFrom
Dim sSubject
Dim sTextBody

sTo = request.form("emailto")
sFrom = "Email@mymail.web01.org"
sSubject = "Web Page Send"
sTextBody = request.form("body")

Dim objMail
'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")

'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject= sSubject
objMail.TextBody = sTextBody

'Send the email
objMail.Send

'Clean-up mail object
Set objMail = Nothing
%>


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/25/2005 16:28:01   
Thanks. Question: do I replace the "form method" section with this ? Or do I add it somewhere on page1.asp ? I'm talking about the first section of code you showed me.

Mike

(in reply to Spooky)
Spooky

 

Posts: 26618
Joined: 11/11/1998
From: Middle Earth
Status: online

 
RE: Results to DB and Email-- REVISITED ! - 8/25/2005 16:34:49   
How are you currently sending the information to database and what is the actual data you want to send via email?


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/25/2005 16:39:46   
I'm afraid this answer will probably sound stoopid but here goes:

frontpage 2003
form on asp page
submit to access database via submit button


I am wanting to email the data that was submitted as it would appear on the results.asp page.

(in reply to Spooky)
Spooky

 

Posts: 26618
Joined: 11/11/1998
From: Middle Earth
Status: online

 
RE: Results to DB and Email-- REVISITED ! - 8/25/2005 16:54:41   
So you are using the Frontpage "submit to database" option?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/25/2005 17:02:04   
Yes. The submit to database option in frontpage '03.

My biggest problem (I hope) was getting email to work from my webserver and then actually get an email to send from a webpage as the page was accessed. This tells me that part of this task is working okay.

What I need to do is when a form is submitted, to send the contents of the form to a specific email recipient in addition to the database submit. It would go to a different person depending on the form that was submitted. Each webpage has only one form on it.

I am learning so much from this forum but I know that I don't know hardly anything. I appreciate your help Spooky. My exerience has been over 15 years of end user support/helpdesk so this is all real new.

Thanks,
Mike

(in reply to Spooky)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/26/2005 9:38:28   
Happy Friday :) !

This morning I was tinkering with a custom confirmation that emails the form data. I am using CDOSYS. when I submit the form on the form.asp page it goes to the custom confirmation page and gives me the following error:


Microsoft VBScript runtime error '800a000d'

Type mismatch: 'FP_SavedFields'

/Maint/Tasks/tasks_confirm.asp, line 19



This is the script I am using on the confirmation page:

<%
Set objCDOMail = Server.CreateObject("CDO.Message")
objCDOMail.To = "mike@mymail.org"
objCDOMail.From = "Email@tex01.org"
objCDOMail.Subject = "Tasks Update"

strBody = strBody & item & ": " & FP_SavedFields(Area) & VbCrLf
strBody = strBody & item & ": " & FP_SavedFields(Description) & VbCrLf
strBody = strBody & item & ": " & FP_SavedFields(Action) & VbCrLf
strBody = strBody & item & ": " & FP_SavedFields(Status) & VbCrLf
strBody = strBody & item & ": " & FP_SavedFields(Hours) & VbCrLf
strBody = strBody & item & ": " & FP_SavedFields(Assigned) & VbCrLf

objCDOMail.Body = strBody
objCDOMail.BodyFormat = 1
objCDOMail.MailFormat = 1
objCDOMail.Send
Set objCDOMail = Nothing
%>


Can you see what I might be doing wrong ?

Thanks !

Mike

(in reply to mtee55)
BeTheBall

 

Posts: 6385
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/26/2005 12:45:46   
This help any?

http://www.frontpagewebmaster.com/m-141000/key-cdonts%252Cdatabase/tm.htm#141000

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/26/2005 14:15:40   
That confused me a bit. Any idea what the following line for CDONTS would be for CDOSYS ?

strBody = strBody & item & ": " & FP_SavedFields(Description) & VbCrLf

or just the complete script. I truly am ignorant and getting more confused as I go. This is for a script on a custom confirmation page to email desired fields to an email address.

Thanks,

Mike

(in reply to BeTheBall)
BeTheBall

 

Posts: 6385
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/26/2005 19:30:57   
Take your working CDOSYS script and place it right after this line:

Session(" FP_SavedValues" )=arFormValues0

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/31/2005 10:16:09   
My confirmation.asp page doesn't have any Session information on it. just the script to send the email.

mike

(in reply to BeTheBall)
BeTheBall

 

Posts: 6385
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/31/2005 10:47:49   
The email script needs to go on the same page as the submission form, not on the confirmation page. The link I provided should show you exactly where on the page to insert the email script.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/31/2005 11:36:20   
Thanks, I had tried that but got an error so thought that since this was a script in it's own right, that it had to go somewhere else. Sorry.

(in reply to BeTheBall)
Joey

 

Posts: 172
Joined: 5/15/2002
From:
Status: offline

 
RE: Results to DB and Email-- REVISITED ! - 8/31/2005 21:59:00   
I use a form on page 1 that submits to a drw on page 2, The drw inserts the record into the database and then I also use the email script below the drw and it works great.

I l;earned it from http://frontpagehowto.com/dbandemail.htm

(in reply to mtee55)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> Results to DB and Email-- REVISITED !
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts