473,386 Members | 1,823 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,386 software developers and data experts.

Email problem

I'm using ASP VBScript. I have a feedback form that should do two things:
insert the contents into a database and send the contents as email. The
address it would be sent to varies - users select the company they want to
send the feedback to from a menubox. The problem is that I can't just type
the email addresses as "option values" since I need to save the company name
to a database. I don't want to save the email addresses. This would
otherwise solve my problem.

I know how to update the database, use CDONTS etc., but I need to find a way
to somehow change the email address the email is sent to depending on the
selection of the menu.

How about using 'OnChange' behavior for the menu and creating a script
function (called SaveEmail) which inserts the email address into a session
variable, depending on the selection? I've tried it, but I receive an error:
"SaveEmail is not defined".

For example:

<script runat="server" language="javascript">
function SaveEmail() {
if (document.form1.Company.value == "My Company")
{ Session("email")=j*******@company.com";
}

etc...
}</script>
Jul 19 '05 #1
1 1685
If you don't mind the e-mail addresses being on the client
then make the VALUE of the combo box for the company name
contain the E-mail also;

<select name=cboCompany....>
<option value="co***@company1.com:Company A">Company A
<option value="co***@someplace.com:Company B">Company B

In your ASP do something like

' Split the value into an array using : as a delimiter
aCompany = SPlit(Request("cboCompany"), ":")
' EMail is in first element
' Name is in second
aEmail = aCompany(0)
aName = aCompany(1)

That way the user only sees "Compny A" in the combo box,
but what you submit to ASP is both the name and the e-mail
address.
-----Original Message-----
I'm using ASP VBScript. I have a feedback form that should do two things:insert the contents into a database and send the contents as email. Theaddress it would be sent to varies - users select the company they want tosend the feedback to from a menubox. The problem is that I can't just typethe email addresses as "option values" since I need to save the company nameto a database. I don't want to save the email addresses. This wouldotherwise solve my problem.

I know how to update the database, use CDONTS etc., but I need to find a wayto somehow change the email address the email is sent to depending on theselection of the menu.

How about using 'OnChange' behavior for the menu and creating a scriptfunction (called SaveEmail) which inserts the email address into a sessionvariable, depending on the selection? I've tried it, but I receive an error:"SaveEmail is not defined".

For example:

<script runat="server" language="javascript">
function SaveEmail() {
if (document.form1.Company.value == "My Company")
{ Session("email")=j*******@company.com";
}

etc...
}</script>
.

Jul 19 '05 #2

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

Similar topics

3
by: jpastora | last post by:
I'm having a strange problem with our email links on the domain : http://www.pc350.com/ . The problem is that when you click on an email link, the email app is not launched until the browser...
6
by: mike | last post by:
I have created a side application in VB.NET which reads rows from a DB and builds an email message. when i have a long string the the mailmessage.body or the mailmessage, it puts in an...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
0
by: VP | last post by:
g'day, i am posting a problem i have encountered with creating an email using outlook through some basic c# code. the problem arises when using different email editors in outlook. At the moment...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
26
by: libsfan01 | last post by:
Hi all! Can anyone show me how to check and email field on a form for the existence of these two characters. Kind regards Marc
0
by: RickVidallon | last post by:
Missing or Truncated Body Text in Email Application - 2 Strange Examples... There is no earthly reason why this is happening! EXAMPLES HERE: http://65.36.227.70/actmailer/ We have a...
3
by: Steven Allport | last post by:
I am working on processing eml email message using the email module (python 2.5), on files exported from an Outlook PST file, to extract the composite parts of the email. In most instances this...
3
by: IGD | last post by:
I don't know if this is the right place to post this or not. If not, could someone direct me elsewhere where I would find more information on how to solve my problem? Thanks! My problem is this:...
28
tdw
by: tdw | last post by:
Hi all, I am trying to add a feature to our database that automates sending emails. When entering a new order, I want the option to send an email to the company the order came from, attaching a...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.