|
Hi,
all code runs within a thread or another the difference is just that you explicitly created the one from which you want to send mail.
It makes no sense for the request to be available outside the "main" thread (the one created by asp.net rather than your code) since the asp.net model is to free all the resources used for a specific request once the response has been sent. It is possible to hack it by keeping your own references to it, but that would be bad to say the least, and not only for performance - you'll never know if the state of the object is good or not, it might be disposed or even reused in a pool for all we know, today or in a future version of ASP.NET.
However, all your method neeeds is to know the quote reference number, so the solution is to make it get this from somewhere other than the request. If you're using at least v2.0 you can use the parameterized thread start delegate and you're done. In 1.x a somewhat more sophisticated solution must be invented, such as using a synchronized ArrayList.
All of this having been said, because I'm such a nice bloke and want you to understand the problem and how one can solve it, I have to say that it is utterly nonsensical to make a new thread for what your sendmessage method is doing. It is not only needlessly complicated but the overhead of creating and starting the thread is huge compared to the amount of work performed in the thread, so its a performance killer to boot. Right here therefore, the solution is simply to get rid of your multithreaded design where a singlethreaded one is far better.
|
|
|
|
|
DON'T CROSS POST You were given answers in the original post.
only two letters away from being an asset
|
|
|
|
|
hi everyone,
Can anyone plz give me a regular expression of strictly (999) 999-9999 format. I've tried to modify the one available in VS .NET 2005 but couldnt do so.
Thanks
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
hi Rocky#,
Moast of the time i have failed due to lacking in the understanding of Regular Expression. So, i downloaded a software which contains a library of REGEX (Regular Expressions), from that i found REGEX of your need.
\((?<AreaCode>\d{3})\)\s*(?<Number>\d{3}(?:-|\s*)\d{4})
Hope this help you. To download this software free of cost try this link.
http://www.ultrapico.com/Expresso.htm
Make other people to aware of such software.
Thanks & Regards
Dilip Kumar Vishwakarma
|
|
|
|
|
Thanks a lot, thats a lot of help,
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
Hi all, quite new to asp.net c# programming, i have a mifare reader PCR310U , i need to develop a website which can retrieve information(like card ID) through website using remote mifare reader in remote computer when surfing the website.
for example, i already published my website, when i'm not at the server computer and at my own house, i have a mifare card reader which is connected to my house's PC and a mifare Card, i wish to register the card ID together with my IC number and save into my system website database. can anyone enlighten me on how to go about doing it?i really have no idea how i can retrieve information through mifare reader through the internet website.
if you can help me pls email me.this system quite urgent for me.
thanks alot
tyrone
tyrone_93@Hotmail.com
|
|
|
|
|
Do not post the same message to multiple forums. See the CodeProject Posting Guidelines.
led mike
|
|
|
|
|
Can any one of u know how to open outlook from asp.net , without "mailto:" function , coz i want to send html page with that outlook
|
|
|
|
|
You can construct a mail message and send it using SmtpMail.
MailMessage msg = new MailMessage();<br />
msg.BodyFormat = MailFormatHtml;<br />
msg.Body = "<html><body>Hello</body></html>";<br />
msg.To = "someone@someplace.com";<br />
SmtpMail.Send(msg);
only two letters away from being an asset
|
|
|
|
|
no ! i want to open outlook with the web page that i give !
thnx in advance
|
|
|
|
|
Perhaps you would like to restate your question and explain exactly what you looking for.
only two letters away from being an asset
|
|
|
|
|
You can open a web version of outlook if your exchange server is set up to serve it. Otherwise, no.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I designed a localreport with a number of columns but would like to show or hide columns at runtime using a report parameter which I set through the aspx page. How do I set the column visiblity at design/runtime according to the parameter value?
|
|
|
|
|
Can you use an IIF expression in the visibility property?
|
|
|
|
|
Thanx,
I did the following: In the tableColumn visiblity i managed to add an IIf expression which test the parameter. Thanx again, Corna
|
|
|
|
|
Thanks Corna, but can u give me a sample code as how u are disabling a column, my problem is I don't want to show column when viewing a report, but when exporting it needs to be there as hidden column in EXCEL.
Anshul
|
|
|
|
|
Didn't try/need this before, I will see if I can find something like this.
|
|
|
|
|
Hi,
Do you by any change have an example of how to print a local report. I've tried the msdn example but can't seem to get it working.
Thanx
|
|
|
|
|
following is the coding which works fine in local machine / but after i made host this on server, it shows "Mail sent successfully" but no mails received in my inbox!
can any one solve this problem!
thnx in advance!
Dim mssg As New System.Web.Mail.MailMessage
mssg.BodyFormat = Web.Mail.MailFormat.Html
mssg.To = txtTo.Text
mssg.From = txtFrom.Text
mssg.Subject = txtSubject.Text
mssg.Body = strMessage
System.Web.Mail.SmtpMail.Send(mssg)
|
|
|
|
|
|
You may need to specify a mail server.
|
|
|
|
|
no it works me in local !
|
|
|
|
|
Yep, but on the production server, the default mail setting is probably disabled. You will need an actual server specified to send out your email.
|
|
|
|
|
iam using encryption methods then web.config file connection strings and appsettings are nicely encryptining .but when iam taking the application in the another system and running its is getting problem.how this could be solved.
|
|
|
|
|
It cannot. If it could it wouldn't be encryption but mere scrambling. The key needed to decrypt the file is stored in a key container and is not copied along with the encrypted data.
|
|
|
|