Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 04:17 PM
Nathaniel Maier
Guest
 
Posts: n/a
Default 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: nmaier@columbus.rr.com
AIM: OSUKid7


  #2  
Old July 20th, 2005, 04:17 PM
Nathaniel Maier
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

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: nmaier@columbus.rr.com
AIM: OSUKid7

"Brian" <usenet1@mangymutt.com.invalid-remove-this-part> wrote in message
news:151Ta.115959$Ph3.14990@sccrnsc04...[color=blue]
> Nathaniel Maier wrote:[color=green]
> > 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[/color][/color]
that?[color=blue]
>
> 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
>[/color]


  #3  
Old July 20th, 2005, 04:17 PM
Nathaniel Maier
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

"Jim Dabell" <jim-usenet@jimdabell.com> wrote in message
news:duOcnVGflMkyb4GiXTWJjA@giganews.com...[color=blue]
>
> [Please don't post upside down]
>
> Nathaniel Maier wrote:
>[color=green]
> > "Brian" <usenet1@mangymutt.com.invalid-remove-this-part> wrote in[/color][/color]
message[color=blue][color=green]
> > news:151Ta.115959$Ph3.14990@sccrnsc04...[color=darkred]
> >> Nathaniel Maier wrote:
> >> > How can I send form results to an email address based on what the[/color][/color][/color]
user[color=blue][color=green][color=darkred]
> >> > 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[/color]
> > that?[color=darkred]
> >>
> >> Include a field on the report that identifies the desired recipient.
> >> Have the form script email the results to that person.[/color]
> >
> > Thx, but could you show me some code? Sry I rarely hard code HTML...so[/color][/color]
if[color=blue][color=green]
> > it isn't too much of a problem could you elaborate a bit more and show
> > some code? Thanks.[/color]
>
> 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
>[/color]

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: nmaier@columbus.rr.com
AIM: OSUKid7


  #4  
Old July 20th, 2005, 04:17 PM
Rob McAninch
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

Nathaniel Maier <news:MJgTa.459$E17.426@fe3.columbus.rr.com>:
[color=blue]
> 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 :-\[/color]

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/
  #5  
Old July 20th, 2005, 04:17 PM
Nathaniel Maier
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address


"Rob McAninch" <rob_13@excite.com> wrote in message
news:Xns93C0D29D76B44rock13com@24.48.107.53...[color=blue]
> Nathaniel Maier <news:MJgTa.459$E17.426@fe3.columbus.rr.com>:
>[color=green]
> > 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 :-\[/color]
>
> 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/[/color]

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?


  #6  
Old July 20th, 2005, 04:17 PM
Brian
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

Nathaniel Maier wrote:[color=blue]
>[color=green][color=darkred]
>>>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[/color][/color]
>[color=green]
>>Include a field on the report that identifies the desired recipient.
>>Have the form script email the results to that person.[/color]
>
> 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.[/color]

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

  #7  
Old July 20th, 2005, 04:17 PM
Nathaniel Maier
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address


"Mark Parnell" <webmaster@clarkecomputers.com.au> wrote in message
news:3f1de4fc$0$23606$5a62ac22@freenews.iinet.net. au...[color=blue]
> Nathaniel Maier wrote:
> [Sending form results to email address selected by user][color=green]
> >
> > 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?[/color]
>
> 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[/color]
Nick[color=blue]
> 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[/color]
to[color=blue]
> do *could* be done in JavaScript, though it won't work for all your[/color]
visitors[color=blue]
> (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
>
>[/color]

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


  #8  
Old July 20th, 2005, 04:18 PM
Mark Parnell
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

Nathaniel Maier wrote:[color=blue]
> "Mark Parnell" <webmaster@clarkecomputers.com.au> wrote in message
> news:3f1de4fc$0$23606$5a62ac22@freenews.iinet.net. au...[color=green]
>> [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?[/color]
>
> No, the user just selects one from a drop down list.[/color]

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


  #9  
Old July 20th, 2005, 04:18 PM
Brian
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

Nathaniel Maier wrote:[color=blue][color=green][color=darkred]
>>>>> 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[/color]
>>[color=darkred]
>>> but could you show me some code? Sry I rarely hard code HTML...[/color]
>>
>> You mean code for the form? Find a contact form on the web and
>> look at the source code.[/color]
>
> 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.[/color]

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

  #10  
Old July 20th, 2005, 04:18 PM
Mr. Clean
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

In article <UnlTa.555$E17.325@fe3.columbus.rr.com>, nmaier@columbus.rr.com
says...[color=blue]
>
> "Rob McAninch" <rob_13@excite.com> wrote in message
> news:Xns93C0D29D76B44rock13com@24.48.107.53...[color=green]
> > Nathaniel Maier <news:MJgTa.459$E17.426@fe3.columbus.rr.com>:
> >[color=darkred]
> > > 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 :-\[/color]
> >
> > 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/[/color]
>
> 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?
>
>
>[/color]

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?
  #11  
Old July 20th, 2005, 04:18 PM
Mr. Clean
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

> Eh, first, I thought it could be done in HTML or javascript. Second, I[color=blue]
> 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.
>[/color]

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 = "mrclean@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='mrclean@pandg.com'>Mr.
Clean</option>";
$addylist = $addylist."<option value='nmaier@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>
  #12  
Old July 20th, 2005, 04:18 PM
Nick Kew
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

In article <MPG.19887a5161fc8086989a37@news-server.austin.rr.com>, one of infinite monkeys
at the keyboard of Mr. Clean <mrclean@protctorandgamble.com> wrote:
[color=blue]
> try this:[/color]

[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
  #13  
Old July 20th, 2005, 04:18 PM
Mr. Clean
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

In article <sqhmfb.r71.ln@jarl.webthing.com>, nick@fenris.webthing.com says...[color=blue]
> In article <MPG.19887a5161fc8086989a37@news-server.austin.rr.com>, one of infinite monkeys
> at the keyboard of Mr. Clean <mrclean@protctorandgamble.com> wrote:
>[color=green]
> > try this:[/color]
>
> [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.
>
>[/color]
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.
  #14  
Old July 20th, 2005, 04:18 PM
Brian
Guest
 
Posts: n/a
Default Re: Send Form Results to User-selected email address

Nathaniel Maier wrote:[color=blue][color=green][color=darkred]
>>>>
>>>>> 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.[/color]
>>
>> Since you "know" C++ "pretty well" then why don't you download
>> PHP and get busy.[/color]
>
> 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.[/color]

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

 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles