473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Send Form Results to User-selected email address

Hi. How can I send form results to an email address based on what the user
selects? e.g. not to the same address all the time, and not to all
addresses, but to the one that the user selects. How can I refer to that?
Thanks for the help.

Nathaniel Maier
email/MSNmsg: nm****@columbus.rr.com
AIM: OSUKid7
Jul 20 '05 #1
13 6189
Thx, but could you show me some code? Sry I rarely hard code HTML...so if it
isn't too much of a problem could you elaborate a bit more and show some
code? Thanks.

Nathaniel Maier
email/MSNmsg: nm****@columbus.rr.com
AIM: OSUKid7

"Brian" <us*****@mangymutt.com.invalid-remove-this-part> wrote in message
news:151Ta.115959$Ph3.14990@sccrnsc04...
Nathaniel Maier wrote:
How can I send form results to an email address based on what the user
selects? e.g. not to the same address all the time, and not to all
addresses, but to the one that the user selects. How can I refer to
that?
Include a field on the report that identifies the desired recipient.
Have the form script email the results to that person.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2
"Jim Dabell" <ji********@jimdabell.com> wrote in message
news:du********************@giganews.com...

[Please don't post upside down]

Nathaniel Maier wrote:
"Brian" <us*****@mangymutt.com.invalid-remove-this-part> wrote in message news:151Ta.115959$Ph3.14990@sccrnsc04...
Nathaniel Maier wrote:
> How can I send form results to an email address based on what the user > selects? e.g. not to the same address all the time, and not to all
> addresses, but to the one that the user selects. How can I refer to

that?

Include a field on the report that identifies the desired recipient.
Have the form script email the results to that person.


Thx, but could you show me some code? Sry I rarely hard code HTML...so if it isn't too much of a problem could you elaborate a bit more and show
some code? Thanks.


You can't do it in HTML reliably. You need a server-side script. Showing
you code is futile, as it depends on what facilities you have available to
you. Read the FAQ:

<URL:http://www.htmlhelp.org/faq/html/forms.html#mailto-form>
--
Jim Dabell


So there's no way to just refer to the data field that contains the email
address? Darn...anyone know of an easier way?

Nathaniel Maier
email/MSNmsg: nm****@columbus.rr.com
AIM: OSUKid7
Jul 20 '05 #3
Nathaniel Maier <news:MJ***************@fe3.columbus.rr.com>:
Umm....okay. I really just thought there would be some
(hopefully easy) way to refer to the email field in the form.
You all say it's pretty easy, yet can't give me code...sry, I
don't see why :-\


Do you want the code in Perl? Python? C? What do you have available
on the server?

For Perl, check the CGI module man page. perldoc CGI.

--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
Jul 20 '05 #4

"Rob McAninch" <ro****@excite.com> wrote in message
news:Xn***********************@24.48.107.53...
Nathaniel Maier <news:MJ***************@fe3.columbus.rr.com>:
Umm....okay. I really just thought there would be some
(hopefully easy) way to refer to the email field in the form.
You all say it's pretty easy, yet can't give me code...sry, I
don't see why :-\


Do you want the code in Perl? Python? C? What do you have available
on the server?

For Perl, check the CGI module man page. perldoc CGI.

--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


The server has php4, Perl, and CGl. Is this really that hard? I would have
figured there would be some way to do it just in javascript or html. I know
C++ fairly well, and I could do that incredibly easily in C++. I would have
figured the same would be true for html. So there's really know way just to
refer to a field of a form?
Jul 20 '05 #5
Nathaniel Maier wrote:
How can I send form results to an email address based on what the user
selects? e.g. not to the same address all the time, and not to all
addresses, but to the one that the user selects. How can I refer to

Include a field on the report that identifies the desired recipient.
Have the form script email the results to that person.


Thx, but could you show me some code? Sry I rarely hard code HTML...so if it
isn't too much of a problem could you elaborate a bit more and show some
code? Thanks.


You mean code for the form? Find a contact form on the web and look
at the source code.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #6

"Mark Parnell" <we*******@clarkecomputers.com.au> wrote in message
news:3f***********************@freenews.iinet.net. au...
Nathaniel Maier wrote:
[Sending form results to email address selected by user]

The server has php4, Perl, and CGl. Is this really that hard? I would
have figured there would be some way to do it just in javascript or
html. I know C++ fairly well, and I could do that incredibly easily
in C++. I would have figured the same would be true for html. So
there's really know way just to refer to a field of a form?
Is the user actually typing in the email address themself or are you just
giving them a few options? If they are typing it in themself, then as

Nick said, it opens it up for spam abuse. If you are just giving them a few
options - e.g. it goes to a different person in your company depending on
their needs, then yes, it can be done, but not in HTML.

ISTM that the problem is in your understanding of HTML. HTML is not a
programming language, it is a markup language (that's what the ML stands
for). It is used to describe the structure of a document. What you want to do *could* be done in JavaScript, though it won't work for all your visitors (those who have JavaScript disabled, those using text or speech browsers,
etc). It is much better done server-side.

--

Mark Parnell
http://www.clarkecomputers.com.au


No, the user just selects one from a drop down list.
Jul 20 '05 #7
Nathaniel Maier wrote:
"Mark Parnell" <we*******@clarkecomputers.com.au> wrote in message
news:3f***********************@freenews.iinet.net. au...
[Sending form results to email address selected by user]

Is the user actually typing in the email address themself or are you
just giving them a few options?


No, the user just selects one from a drop down list.


In that case, you could easily do it in your form mail script. I could give
you an example in ASP, but since you don't have access to that on your
server, that's not going to help you much. Ultimately, the answer to your
original question remains the same - yes it is possible, but not in HTML.
You will need to use a server-side script.

HTH

--

Mark Parnell
http://www.clarkecomputers.com.au
Jul 20 '05 #8
Nathaniel Maier wrote:
> How can I send form results to an email address based on
> what the user selects? e.g. not to the same address all the
> time, and not to all addresses, but to the one that the
> user selects. How can I refer to

but could you show me some code? Sry I rarely hard code HTML...


You mean code for the form? Find a contact form on the web and
look at the source code.


That's the thing...I haven't been able to find one yet, and there's
no easy way to search the internet for that :-\ That's why I came
here.


Google for "contact form."

Here's one to get you started.

< http://www.julietremblay.com/site/contact.html >

--
Brian
follow the directions in my address to email me

Jul 20 '05 #9
In article <Un***************@fe3.columbus.rr.com>, nm****@columbus.rr.com
says...

"Rob McAninch" <ro****@excite.com> wrote in message
news:Xn***********************@24.48.107.53...
Nathaniel Maier <news:MJ***************@fe3.columbus.rr.com>:
Umm....okay. I really just thought there would be some
(hopefully easy) way to refer to the email field in the form.
You all say it's pretty easy, yet can't give me code...sry, I
don't see why :-\


Do you want the code in Perl? Python? C? What do you have available
on the server?

For Perl, check the CGI module man page. perldoc CGI.

--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


The server has php4, Perl, and CGl. Is this really that hard? I would have
figured there would be some way to do it just in javascript or html. I know
C++ fairly well, and I could do that incredibly easily in C++. I would have
figured the same would be true for html. So there's really know way just to
refer to a field of a form?


Since you "know" C++ "pretty well" then why don't you download
PHP and get busy. It is not *that* much different and the syntax
is definately comparable. What you are asking for here is for someone
to write it for you, correct?
Jul 20 '05 #10
> Eh, first, I thought it could be done in HTML or javascript. Second, I
figured it could be done in just a few lines of code if it was in php or
cgi. But I guess no one will help me, so I'll spend hours trying to learn
php just so I can use it on one form....great.


Well, it's a little more than "just a couple of lines" as you need to check
for existance of an address and so on...

try this:

<?php
// Here is a modified script form:
// http://www.stargeek.com/scripts.php?script=12&cat=blog
$mail_from = "mr*****@pandg.com";
$mail_to = $_POST['to_email'];

$mail_subject = "Contact Form";
if ($_POST)
{
if($_POST['from_email'])
{
if(mail($mail_to, $mail_subject, $_POST['from_name']."\n".$_POST
['from_mail']. "\n". $_POST['userMessage']))
{
$html = 'Your email was sent';
}
else
{
$html = 'There was an error';
}
}
}
else
{
$message = "<textarea name='userMessage'></textarea>";
$name = "<input type='text' name='from_name'>";
$reply = "<input type='text' name='from_email'>";

$addylist = "<select name='to_email'>/n";
$addylist = $addylist."<option selected value='mr*****@pandg.com'>Mr.
Clean</option>";
$addylist = $addylist."<option va***********@columbus.rr.com'>Nathaniel
Maier</option>";
$addylist = $addylist."</select>";

$send = '<input type="submit" name="submit" value="Send">';

$html = "
<p>
To Contact Stargeek:
</p>
<form action=\"$PHP_SELF\" method=\"post\">
<table class=\"bodyBlack\" border=\"0\" cellspacing=\"5\">
<tr>
<td>Your Name:$name</td>
</tr>
<tr>
<td>Your Email:$reply</td>
</tr>
<tr>
<td>Select Person to send to: $addylist</td>
</tr>
<tr>
<td colspan=\"2\" align=\"center\">Additional Message
</td>
</tr>
<tr>
<td colspan=\"2\" align=\"center\">$message</td>
</tr>
<tr>
<td colspan=\"2\" align=\"center\">$send</td>
</tr>
</table>
</form>
";
}
?>
<html>
<head>
</head>
<body>
<?=$html?>
</body>
</html>
Jul 20 '05 #11
In article <MP************************@news-server.austin.rr.com>, one of infinite monkeys
at the keyboard of Mr. Clean <mr*****@protctorandgamble.com> wrote:
try this:


[classic spam gateway code snipped ]

Don't ever put that on the web. It's only a matter of time before
the spammers find it.

That illustrates precisely why you shouldn't try to do this unless
you properly understand the issues.

--
Nick Kew

In urgent need of paying work - see http://www.webthing.com/~nick/cv.html
Jul 20 '05 #12
In article <sq***********@jarl.webthing.com>, ni**@fenris.webthing.com says...
In article <MP************************@news-server.austin.rr.com>, one of infinite monkeys
at the keyboard of Mr. Clean <mr*****@protctorandgamble.com> wrote:
try this:


[classic spam gateway code snipped ]

Don't ever put that on the web. It's only a matter of time before
the spammers find it.

That illustrates precisely why you shouldn't try to do this unless
you properly understand the issues.

All he would have to do is check to see if the to-email matches what he has in
his select items and if they do not match, don't send anything. Spammers or
not, it wouldn't work if you didn't chose one of the items in the select.
Jul 20 '05 #13
Nathaniel Maier wrote:

> I really just thought there would be some (hopefully easy)
> way to refer to the email field in the form. You all say
> it's pretty easy, yet can't give me code...sry, I don't see
> why :-\

Do you want the code in Perl? Python? C? What do you have
available on the server?

For Perl, check the CGI module man page. perldoc CGI.

The server has php4, Perl, and CGl.


Since you "know" C++ "pretty well" then why don't you download
PHP and get busy.


But I guess no one will help me, so I'll spend hours trying to
learn php just so I can use it on one form....great.


Before getting exasperated, you should realize that your original
question was entirely clear. I thought you wanted the html code,
which is the form mark-up. It looks like you want the server-side
script to process that code. Have you Googled for form mail script?

Actually, I just did. *NB*: the first link is to Matt's Script
Archive, whose scripts have serious security flaws that allow spammers
to use your server as a mail mule. Try instead

< http://nms-cgi.sourceforge.net/ >

--
Brian
follow the directions in my address to email me

Jul 20 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Danny Anderson | last post by:
Hola, PHP folk! I have a php page that contains a self-processing form. The form holds search results. The search terms originally came from the previous page, but the user can repeatedly...
2
by: Steve | last post by:
I'm working in PHP, but am also using JavaScript, so perhaps there is a better way to do this using more PHP code...... I setup a search screen for my database, the user enters data and submits...
29
by: | last post by:
I did a working code with CDONTS on NT4 Now I am testing is on w2k and it looks like objCDONTS.Send is completely ignored. I think is it ignored because it throws no errors, neither does the...
4
by: Tony | last post by:
Hello, Using Access2000, WinNT. Using the Immediate Window, I can view the results of my VBA code as it performs operations/calculations on my data. Now that I have all the bugs worked out,...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
4
SHOverine
by: SHOverine | last post by:
I have a 3-part form that I am having trouble with. First part is to select the user group and the week and year that I want to submit results for, this calls the elements that I want to update. ...
4
by: Joseph Geretz | last post by:
We use a Soap Header to pass a token class (m_Token) back and forth with authenticated session information. Given the following implementation for our Logout method, I vastly prefer to simply code...
4
by: dac | last post by:
I am quietly going insane on this project. I've never worked on a project like this one before. All my previous sticky forms were for data entry, not editing. I don't know how to display the form...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
3
by: Bam | last post by:
Hey gang. I have searched the web, and can't find what i need. hoping someone here can help i have a form that pops up based on a click. the popup opens up correctly. now what i want it to do is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.