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

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
Choice-QuoteAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AerosSagaCommented:
are you storing your state in SQL server or using inproc?
0
tusharashahCommented:
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
ryerrasCommented:
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
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Choice-QuoteAuthor Commented:
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
tusharashahCommented:
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
tusharashahCommented:

    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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AerosSagaCommented:
very nice answer tusharashah;)

0
tusharashahCommented:
just learning from you Aeros..;)
0
Choice-QuoteAuthor Commented:
Genius... I owe you a pint!

0
tusharashahCommented:
Allright...  have a ePint then..

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

-tushar
0
AerosSagaCommented:
brilliant!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.