473,563 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="javas cript">
function SaveEmail() {
if (document.form1 .Company.value == "My Company")
{ Session("email" )=j*******@comp any.com";
}

etc...
}</script>
Jul 19 '05 #1
1 1692
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***@co mpany1.com:Comp any A">Company A
<option value="co***@so meplace.com:Com pany 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="javas cript">
function SaveEmail() {
if (document.form1 .Company.value == "My Company")
{ Session("email" )=j*******@comp any.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
1921
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 window is minimized or you switch to a different application. Please try clicking on any email link to know what I'm talking about. The code has been...
6
3454
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 "!<linefeed><space>" at about every 980th space. I have confirmed that these characters are not in the string or the message body before the email is sent....
88
12376
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
2140
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 i am using outlook 2000. Outlook can be configured to use the default outlook email editor or use ms word as the email editor in outlook. The...
14
9115
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 local default SMTP Server and my from address is a valid Yahoo/Hotmail address. I have configures the local SMTP Server to allow the IP Address...
26
2688
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
4211
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 scheduled task which runs every 5mins and sends pending email campaign. The script has been written in VB.NET and following is the code which
3
3826
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 works fine, the message is read in using message_from_file, is_multipart returns True and I can process each component and extract message attachments....
3
8926
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: I am writing an application for work. This application sends a basic html email via SMTP to a group. In this group are individual people's emails,...
28
4404
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 copy of our work order. The file that I want to attach is a rich text document created by Access and stored on our server. The creation of this...
0
7583
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.