Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Can I use asp mail to send htm form?
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

Alfred
Senior Member

USA
1527 Posts

Posted - 02 February 2003 :  21:33:30  Show Profile  Visit Alfred's Homepage
Snitz vs. 3.4.03
dutyreport.txt

I have an asp page containing a form in htm, which I want to mail with my Jmail.
I have tried all kinds of things, but it only mails me the text, without the "M_Name" and "Name".
quote:
if strEmailVal = "1" then
'## mail me start ############################
strRecipients = "battlegroup@ggholiday.com"
strsubject = "Relief of Command Request"
strMessage = "by: " & Request.Form("M_Name")
strMessage = "Relief requested at: " & Request.Form("Name")
%>
<!--#INCLUDE file="inc_mail.asp" -->
<%
end if
'## mail me end ############################

Also, what has to go into the "action" for that?
<form name="dutyform" method="post" ENCTYPE="text/plain" action="?">

Alfred
The Battle Group
CREDO

laser
Advanced Member

Australia
3859 Posts

Posted - 03 February 2003 :  04:24:58  Show Profile
Hi Alfred,

It looks like your forms don't contain those fields - for the strMessage bit.

For the action I would have the asp page containing the code you have quoted.
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 03 February 2003 :  13:35:20  Show Profile  Visit Alfred's Homepage
Isn't this one of the two fields:
quote:
<select name="Duty_Report">
<option value="none" selected>Select your Name!</option>
<%
do while not myMembers.eof
response.write "<option value=""" & myMembers("M_NAME") & """>" & myMembers("M_NAME") & "</option>" & vbNewLine
myMembers.movenext
loop
%>
</select>

Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 03 February 2003 :  14:58:40  Show Profile
No, the name of the form field is Duty_Report
quote:
Originally posted by Alfred

<select name="Duty_Report">
<option value="none" selected>Select your Name!</option>
<%
do while not myMembers.eof
response.write "<option value=""" & myMembers("M_NAME") & """>" & myMembers("M_NAME") & "</option>" & vbNewLine
myMembers.movenext
loop
%>
</select>

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 03 February 2003 :  15:00:43  Show Profile
Fields from the database, yes.
Form obect, I don't think so . .although I'm not really sure. I have problems getting select's to work sometimes (just my brain ), but I would try Request.Form("Duty_Report") and see what you get.

I just had a look at your first post again, and you'll need to change it to :


strsubject = "Relief of Command Request"
strMessage = "by: " & Request.Form("M_Name")
strMessage = strMessage & " Relief requested at: " & Request.Form("Name")


The code also means that you get :

by: laser Relief requested at: laser

so maybe you need to do :

strMessage = strMessage & " Relief requested at: " & Now()
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 03 February 2003 :  15:59:59  Show Profile  Visit Alfred's Homepage
I see - the "Select" name is the form field name!

For uniformity I renamed the two select statements "myMembers" and "myScen" and put those two names into the mail request:
quote:
## mail me start ############################
strRecipients = "battlegroup@ggholiday.com"
strsubject = "Relief of Command Request"
strMessage = strMessage & " by: " & Request.Form("myMembers")
strMessage = strMessage & " Relief requested at: " & Request.Form("MyScen")
%>
<!--#INCLUDE file="inc_mail.asp" -->
<%
'## mail me end ############################
but all I get in the mail is this: by: Relief requested at:

Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 03 February 2003 :  16:59:19  Show Profile
action is the page to send the form data to process the results, so you need to put the name of the page that you are using to send the email.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 03 February 2003 :  17:30:56  Show Profile  Visit Alfred's Homepage
But Nikkol, I want to have it sent to my email address.
If I leave that as the action, the way I do it in html:
<form name="dutyform" method="post" ENCTYPE="text/plain">action="mailto:alfred@ggholiday.com">
- would it not be mailed twice then, once by my server and once by the user's email client?

Or do you mean our inc_mail.asp page?
So it would have to look like this:
<form name="dutyform" method="post" ENCTYPE="text/plain" action="inc_mail.asp">

No, that didn't do anything but bring up an empty inc_mail.asp page...


Alfred
The Battle Group
CREDO

Edited by - Alfred on 03 February 2003 17:39:24
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 03 February 2003 :  17:43:12  Show Profile  Visit Alfred's Homepage
Laser, the "at" does not refer to time, but location of Scenario!
All scenarios are in my database as text fields.

Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 03 February 2003 :  18:00:18  Show Profile
action="processmailpage.asp"

and processmailpage.asp has the following code in it:
## mail me start ############################ 
strRecipients = "battlegroup@ggholiday.com"
strsubject = "Relief of Command Request"
strMessage = strMessage & " by: " & Request.Form("myMembers")
strMessage = strMessage & " Relief requested at: " & Request.Form("MyScen")
%>
<!--#INCLUDE file="inc_mail.asp" -->
<%
'## mail me end ############################

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 03 February 2003 :  18:42:08  Show Profile  Visit Alfred's Homepage
Now I am really confused, Nikkol.

I should make a small file called "processmailpage.asp" and put the short chunk of code in it?
How does that file know about my two "select" fields, which are in the "dutyreports.asp"?

Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 03 February 2003 :  19:09:06  Show Profile
because of the request.form ... see my other post here ... http://forum.snitz.com/forum/topic.asp?TOPIC_ID=41218

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~

Edited by - Nikkol on 03 February 2003 19:09:59
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 03 February 2003 :  19:58:03  Show Profile  Visit Alfred's Homepage
Oh, you can request forms from your whole website?
I thought it has to be in the same file!
This means one has to take care not to use the same names more than once...

Ok, I did as you said now, but still only got this in the mail:
"by: Relief requested at: "

BTW, just saw your final post you linked to.
Will try to find that.

Still didn't solve this failure here though...


Alfred
The Battle Group
CREDO

Edited by - Alfred on 04 February 2003 16:55:08
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 05 February 2003 :  05:15:17  Show Profile
Alfred, can you upload the latest file you have as a text file ?

Thanks
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 05 February 2003 :  10:46:56  Show Profile  Visit Alfred's Homepage
Laser,
here is the "dutyreport.txt": http://www.ggholiday.com/bg/forums/dutyreport.txt

The processmail.asp contains this only:
quote:
strRecipients = "battlegroup@ggholiday.com"
strsubject = "Relief of Command Request"
strMessage = strMessage & " by: " & Request.Form("myMembers")
strMessage = strMessage & " Relief requested at: " & Request.Form("MyScen")
%>
<!--#INCLUDE file="inc_mail.asp" -->
<%

Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 05 February 2003 :  11:18:48  Show Profile
Your duty report page has an error Alfred:

Microsoft JET Database Engine error '80040e37'

The Microsoft Jet database engine cannot find the input table or query 'SCENARIOS'. Make sure it exists and that its name is spelled correctly.

/bg/forums/dutyreport.asp, line 23

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07