|
According to MSDN[^]:
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.Proxy = GlobalProxySelection.GetEmptyWebProxy();
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
|
|
|
|
|
I have a form that I want to send to different email addresses dependant upon a user selection.
(I received some help with this the other day, but I am trying a slightly different approach, for reasons too boring to go into).
<form action="../" enctype="text/plain">
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
<input name="Customer Name :" size="60"
style="background-color: #FFFFCC; text-align: left;" type="text" value="Name" />
<input name="Telephone Number :" size="60"
style="background-color: #FFFFCC; text-align: left; width: 202px; margin-left: 42px;"
type="text" value="Tel No." />
</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 12px; width: 655px;"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Please use our contact form to make any enquiries.</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Type of enquiry?</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
<select id="SelectContactType" name="sendEmailTo" onchange="setAction">
<option value="mailto:sales@fosbern.co.uk">Sales</option>
<option value="mailto:colin@fosbern.co.uk">Contractor</option>
<option value="mailto:pat@fosbern.co.uk">Technical</option>
<option value="mailto:enquiries@fosbern.co.uk">Other</option>
</select>
</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Your Question...</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 62px;">
<textarea rows="3" cols="2" id="TextArea1" name="Question :"></textarea>
</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Finally, Your Email Address...</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
<input name="Customer Email Address :" size="60"
style="background-color: #FFFFCC" type="text" />
<input
type="button"
value="Send"
onclick="location.href=this.form.sendEmailTo.options[sendEmailTo.selectedIndex].value"/>
</p>
<p align="center" style="width: 367px">
Press the Submit Button and we will contact you shortly with details, prices
etc
.</p>
</form>
I have managed to get the email to fire up with the correct address, but it is not filling in the form details.
Probably something simple, but I am full of dimness tonight.
Any help?
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
modified on Thursday, April 8, 2010 5:08 PM
|
|
|
|
|
Dalek Dave wrote: it is not filling in the form details.
What do you mean? When viewed in your email client, like Outlook, the form is not getting filled in? A form is rendered by a web server, which Outlook, or any other mail client, is not.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
This code produces an email that contains the details from the user...
(See Here for website[^]
I want the same effect, ie the details sent within the body of the email, but the previous example is not filling in the body.
<form method="post" enctype="text/plain" action='mailto:sales@bellcross.co.uk&cc=david@bellcross.co.uk'>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><input
style="background-color: #FFFFCC; text-align: left;" type="text" size="60"
name="Customer Name :" value="Name" /><input
style="background-color: #FFFFCC; text-align: left; width: 202px; margin-left: 42px;"
type="text" size="60" name="Telephone Number :" value="Tel No." /></p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 12px; width: 655px;"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Tell us what you are looking for, we
can search our records to match you with the house you want!</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
<select id="Select1" name="Location">
<option value="Bletchley">Bletchley</option>
<option value="Milton Keynes">Milton Keynes</option>
<option value="Watford">Watford</option>
<option value="Flitwick">Flitwick</option>
<option value="Harlington">Harlington</option>
<option value="Buckingham">Buckingham</option>
</select><select id="Select2" name="No of Beds">
<option value="1 Bed">1 Bed</option>
<option value="2 Bed">2 Bed</option>
<option value="3 Bed">3 Bed</option>
<option value="4 Bed">4 Bed</option>
<option value="5 Bed">5 Bed</option>
</select><select id="Select3" name="House Type">
<option value="Apartment">Apartment</option>
<option value="Maisonette">Maisonette</option>
<option value="Terraced">Terraced</option>
<option value="Semi-Detached">Semi-Detached</option>
<option value="Detached">Detached</option>
<option value="Executive">Executive</option>
</select></p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Finally, Your Email Address...</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
<input style="background-color: #FFFFCC" type="text" size="60" name="Customer Email Address :" />
<input id="Button1" type="submit" value="Submit" /></p>
<p align="center">Press the Submit Button and we will contact you shortly with
details, prices etc.</p>
</form>
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Sorry, still not quite following what you want to do.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Ok
I have a webpage that the user fills in details on.
(Name addy etc), he selects the type of query it is, Sales, Contractors etc.
The selection he makes in the dropdownlist selects an email address to send the formdata to.
So, data filled, user hits the SEND button and the email client opens and sends mail to the correct address.
However the data in the form is not placed into the body of the email.
The second code list I sent will put the data into the email, but does not allow for selection of emailto.
The first code list allows for the selection of the email addy but does not put the data into the body.
ANNOYING!
So is there anyway to send the data in the form within the first code section?
I cannot see why it doesn't.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
I'm not going to repeat myself. Look at the Quick Answer response.
I will repeat though I think it is wrong to post the same question to both places.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Still not working.
<input
id="Button1"
type="button"
value="Send"
onclick="location.href=this.form.sendEmailTo.options[sendEmailTo.selectedIndex].value"/>
I think there is something in this line.
Is there an option to put body="userdata" into it somewhere?
PS, sorry for double posting. Running out of brains and time.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Are you using IE8? I've found it works with Chrome but not IE8.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
ff, odd though, it ought to work, I cannot see why it doesn't.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
I have marked you up for the effort you put in on my behalf, (and the telling off! ).
Thanks Mark.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
ok looking at this code ...
<form action="../" enctype="text/plain">
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
<input name="Customer Name :" size="60"
style="background-color: #FFFFCC; text-align: left;" type="text" value="Name" />
<input name="Telephone Number :" size="60"
style="background-color: #FFFFCC; text-align: left; width: 202px; margin-left: 42px;"
type="text" value="Tel No." />
</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 12px; width: 655px;"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Please use our contact form to make any enquiries.</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Type of enquiry?</p>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
<select id="SelectContactType" name="sendEmailTo" onchange="setAction">
<option value="mailto:sales@fosbern.co.uk">Sales</option>
<option value="mailto:colin@fosbern.co.uk">Contractor</option>
<option value="mailto:pat@fosbern.co.uk">Technical</option>
<option value="mailto:enquiries@fosbern.co.uk">Other</option>
</select>
This first input element where
name="Customer Name :"
needs to be ...
name="CustomerName"
Now where you have the maito ...
="mailto:sales@fosbern.co.uk"
Make it like this ...
="mailto:sales@fosbern.co.uk?subject=HomeQuery&body="
Next where you have ...
onclick="location.href=this.form.sendEmailTo.options[sendEmailTo.selectedIndex].value"/>
do this ...
onclick="location.href=this.form.sendEmailTo.options[sendEmailTo.selectedIndex].value + this.form.CustomerName.value"/>
OK that just adds a subject and the name to the body,
just add more form.element.valuues to get the rest.
|
|
|
|
|
That "Thud" noise was me realising a basic error!
It seems obvious when pointed out, I knew it had to be something simple.
(I too am simple it seems!)
Thanks Very Much, I was off trying to write some php for it, still, it is late, I am in bed, and the wife is annoyed, so I shall halt and try in the morning.
Cheers.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Curious that non-IE browsers will fill in the email body without specifying the body in the action.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
how to insert special characters into ms acess database
i m inserting text along with ' " ? in a text box but it gives error
i have used memo type in ms acess and also i have written cstr(textbox)
still it does not insert the record into database plz help.
|
|
|
|
|
It depends on how you are inserting the data. If the SQL ends up looking like
INSERT MyTable (FirstName, LastName) VALUES ('Charles', 'O'Banion')
you will have a problem as the auto-formatting shows: the apostrophe in the last name gets treated as a delimiter, causing the insert to fail with a syntax error.
What you need to do is use parameters to pass the data into your database. I am not sure of how to do this in DAO, it has been a VERY long time since I've written anything for Access. You can probably find the how-to very easily, though.
Keep in mind that allowing special characters like single quotes and the wildcard characters * , ? and # might cause problems latter if you want to use LIKE to search for those characters. For example,
SELECT * FROM MyTable WHERE Password LIKE 'hot*shot'
would return every record where Password starts with "hot" and ends with "shot", with any number of characters in between. You will need to figure out whether the splat is a wildcard or a literal and, if it is a literal, wrap it in square brackets so the actual statement becomes
SELECT * FROM MyTable WHERE Password LIKE 'hot[*]shot'
This tells Access to treat the splat as a literal and not as a wildcard. I am not sure if parameter fields will treat wildcard characters as wildcards or literals in this case. You can also avoid the problem entirely by not using LIKE ;
SELECT * FROM MyTable WHERE Password = 'hot*shot'
will work as expected.
|
|
|
|
|
Hi
Does anyone know of a way to launch an application as a different user account from a Classic ASP page? So, I would be launching, for example, OIS.exe as a different user account to the logged-on user.
This is on an intranet, so is relatively safe.
Cheers
|
|
|
|
|
Classic asp, asp.net or written with notepad it just doesn,t matter. All the browser sees is the HTML, it doesn't care how you were able to produce the HTML. Try this....
<script>shell = new ActiveXObject("WScript.Shell");
shell.run('C:\\myserver.exe');</script>
|
|
|
|
|
It doesn't matter whether its classic asp or not, the browswer will restrict you from opening some exe for security reasons.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello,
I've a jquery.ajax call. The result I set on server side is a string containing html fragment (some table rows). But on client side I get the result enclosed in
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http:...>
Here comes my html fragment
</string>
In addition, in my html fragment each special html character like < or > are replace during the html codings < and >
I don't understand why and I don't know, how I can get or extract my original result. Here is my short ajax function:
function DoAjaxCall(bofg_refid, pc_refid)
{
$.ajax({
type: "GET",
url: "../Test.asmx/TestCall",
data: "bofg_refid=" + bofg_refid + "&pc_refid=" + pc_refid,
dataType: "text",
success: function(html) {
alert(html);
}
});
}
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href="http://www.stephan-pilz.de">www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
|
What a nice way to say RTFM.
|
|
|
|
|
Thank you both for the very nice and very unhelpful message. I'm not a stupid programmer. I know the web ressources and online docus and I can and have read it. And if it would help, I would not post some questions here.
All other guys with helpful informations: Please let me know.
Thank you
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href="http://www.stephan-pilz.de">www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
Change your alert to this
alert(html.split(">")[2].split("<")[0].replace("<","<").replace(">",">"))
You may need to use < instead of >
also other characters may have been encoded which
will als need replacing.
Good Luck.
|
|
|
|
|
You obviously didn't read the docs very well.
http://api.jquery.com/jQuery.ajax/[^]
Read the section on dataType and it will explain why your data comes back as XML. Look at the example of a success handler and you would have the code you need. Read the sentence after that example and it will point you to a better way to do it.
|
|
|
|