You just need to..
objMail.From = Request.form("sendmail_bcc
Main Topics
Browse All TopicsI have built a form with a call to a cgi script (sendmail.cgi) that uses a templete to control the e-mail output. All areas work properly except for one.
I have a field for a user to input their name:
<INPUT type="text" name="template_mandatory_a
which works fine.
Now I want to provide a "bcc" to the user using the name given above. I think I'm on the right track but am missing the proper syntax to make it work properly. Here's what I have tried for a "bcc" back to the user:
<input type="hidden" name="sendmail_bcc" value="template_mandatory_
The resulting "from:" in the e-mail shows:
FROM: template_mandatory_alpha..
Instead of the users name input into the name field.
How do I use the users name as a variable for other "sendmail" fields?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The reference to the name is:
document.formname.template
HTML cannot reference a form variable. You have to use JavaScript off an event:
document.formname.sendmail
You can use an onCleck event on the submit button to populate the field
In that example you need to change "formname" to whatever name you have given the form.
Cd&
Part of my problem is that I don't have access to the original script. Plus I don't feel I have enough experience writing cgi scripts to be able to modify it if I could get my hands on it.
What I am given is a vague list of what the script is "capable" of with very little detail.
What I am faced with is putting together a form on a UNIX server or I would use ASP which I have done in the past.
Not being too familiar with what options are available with UNIX I was hoping to do the scripting with all html.
I was hoping to be able to have a standard feedback form and when the user sends there feedback they would also receive a "cc" and it's the "cc" part that I am having difficulty with.
If needed I could use JavaScript put was hoping for straight html.
What Marsman has suggested works put for only 1/2 of the problem.
<INPUT type="text" name="sendmail_bcc" size="39" maxlength="256">
This sends the "bcc" put I am also using a template to format the output and because of the way the script is written I also need;
<INPUT type="text" name="template_mandatory_a
to be compatable with the cgi script's template instructions otherwise the user's name will not appear in the e-mail output.
Okay you need to do it client side. It does not take a lot of JavaScript. One line on the blur event for the text input:
<INPUT type="text" name="template_mandatory_a
onBlur="this.form.sendmail
Automatically populates both fields when the field is filled in.
Cd&
Doing that on the server can make "you" read the private mail from toher people though...which i hope won't be happening.
I agree with Cd&'s code, but even better would be:
<INPUT type="text" name="template_mandatory_a
onBlur="this.form.sendmail
It's a weird line I wrote there. let me explain in a use case:
I go to a website where I can write a mail to a certain person. I don't know who the website is from though, but assume all is okay. I write a sexually tinted letter to a friend of mine (for clarification purposed) and enter her email also. If the website underlying adds his or her own email address in the BCC (which won't be visible after being sent) that person also gets the same email address. he or she can then read my private letter.
of course this can happen in a lot of other cases also (look at Outlook in a company, or your provider), but from a website it is different. Companies have their guidelines, while people who like to create websites as a hobby have not or do not like to follow them.
I hope I made myself clear :-)
CJ
It HAS to be done server side -- just having a form field doesn't put that value as the cc/bcc field of the e-mail, it just puts it in the e-mail BODY along with the rest of the contents. If you want it to be the cc/bcc address, you MUST alter the server script to put that form field contents into the cc/bcc line.
And if you want them all to have the same cc/bcc, it would make sense to code it into the CGI directly, then not only does it not matter what form is feeding into the CGI, the user can't see the cc/bcc or that it even is being sent to anybody other than the recipient.
Not contributing to the question:
CJ_S
your example is a bit strange.
Of course you can add your own emailaddress in the serversidescript to the email if you solve this serverside.
But you can also add your own emailaddress in the serversidescript to the email if you solve this clientside.
It's all about trust if you use something like this. Nobody would notice whether you solve this problem clientside or serverside so it wouldn't influence any trustworthyness. I really don't see the difference.
Business Accounts
Answer for Membership
by: Marsman_Posted on 2002-01-02 at 13:31:56ID: 6706049
Please show us your cgi-script...