[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Quick Question. Urgent. Help with ASP email and session variables.

Posted on 2004-10-29
11
Medium Priority
?
217 Views
Last Modified: 2006-11-17
I'd like to send and email contaiing all stored sessions using ASP.NET.

The variables will change on a regular basis, so it needs to be automated... just mail all stored variables.

Make sense?

       meMail.To = eAddress
        meMail.Bcc = eAddressBCC
        meMail.From = eAddressFrom
        meMail.BodyFormat = MailFormat.Html
        meMail.Subject = "Your quote from "
        meMail.Body = *** ALL MY SESSION VARIABLES IN HERE ***    
        SmtpMail.SmtpServer = "0.0.0.0"
        SmtpMail.Send(meMail)


Regards,
Craig
0
Comment
Question by:Choice-Quote
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12446359
are you storing your state in SQL server or using inproc?
0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12446427
For retrieving Session Values you can use something like following:

Dim i As Integer = 0
While i < Session.Count
 str1 += Session(i).ToString()
 i += 1
End While

-tushar
0
 
LVL 6

Expert Comment

by:ryerras
ID: 12446456
If you are using InProc, you have to assign each session variable individually or concat them in a big string variable or array or whatevr you choose to. You can not email somethin like a session object
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Choice-Quote
ID: 12446460
I'm storing them as session variables. not in sql.

Tushar... how would I include this in the body of my email?

Regards,
Craig
0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12446472
Or this would be more accurate with Key names..
Dim str1 As String = "" 
Dim i As Integer = 0
While i < Session.Count
 str1 += Session.Keys(i).ToString() + ":" + Session(i).ToString()
 i += 1
End While
0
 
LVL 18

Accepted Solution

by:
tusharashah earned 2000 total points
ID: 12446479

    Dim str1 As String = "" 
Dim i As Integer = 0
While i < Session.Count
 str1 += Session.Keys(i).ToString() + ":" + Session(i).ToString()
 i += 1
End While
   
    meMail.To = eAddress
        meMail.Bcc = eAddressBCC
        meMail.From = eAddressFrom
        meMail.BodyFormat = MailFormat.Html
        meMail.Subject = "Your quote from "
        meMail.Body = str1                                         'Just Assign your string here    
        SmtpMail.SmtpServer = "0.0.0.0"
        SmtpMail.Send(meMail)

-tushar
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12446626
very nice answer tusharashah;)

0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12446660
just learning from you Aeros..;)
0
 

Author Comment

by:Choice-Quote
ID: 12446739
Genius... I owe you a pint!

0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12447127
Allright...  have a ePint then..

http://www.e-pint.com/epint.jpg

-tushar
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12447138
brilliant!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question