473,703 Members | 2,421 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 1699
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
1928
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 thoroughly checked, I found no errors. The thing is, this behaviour has something to do with the...
6
3476
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. Has anyone seen this or have any thoughts? Thanks
88
12509
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
2144
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 sample code below simply creates an email with a hyperlink. The problem I am facing is that when...
14
9132
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 127.0.0.1.
26
2772
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
4221
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
3836
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. I am however running into problem with email messages that contain emails forwarded as...
3
8961
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, but also about 5 other groups. The problem is that the email is only getting received by (or sent...
28
4424
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 document is not the problem. The problem is getting the email option to work. It does not seem to...
0
8760
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8670
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9122
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9017
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8967
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6592
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5923
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4433
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2070
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.