Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2004, 07:38 AM
Authorized User
 
Join Date: Aug 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Prabhakar_dt
Default Using Session value in Sendmail

Hi,
  Thanks to all..for answering my previous queries..

My question is

I have two session variables
  1. session("username") and
  2. session("pass")

Now I want send email to any registerd user his username and password. Problem is that how I will send the session variables in email's body part.

If any one has solution of my problem...please reply me....


Prabhakar

Prabhakar Kumar
__________________
Prabhakar Kumar
 
Old September 17th, 2004, 07:59 AM
Authorized User
 
Join Date: Jan 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Think you can place them in variables, then add them in the message body.

eg. strUsername = session("username")

     strPass = session("pass")

     strBody = "Username: " & strUsername

     strBody = strBody & "Pass: " & strPass

     objMail.body = strBody


Hope this helps. Found I can use a session variable for .TO and .CC without passing to a variable but can't inside the message body.

Lindsey :)
 
Old September 17th, 2004, 11:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Session values in the format Session("key") are a string value, just like a variable. Use it like shown above.

Brian
 
Old September 18th, 2004, 02:34 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Cant say I have ever had the need to pass session vars into an email however, I'm very sure you can pass them into any mail object value including the .body, they are all just string values.

Wind is your friend
Matt
 
Old September 18th, 2004, 02:44 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

You can send any thing in mail body and as sessionss are just like variables to hold the value of some thing so they can be sent in mail as in mail body.


objname.body= "User Name = " & Session("user") & "<BR> Password = "& Session("pass")



Numan
--------------------------------------------------
Love is the most precious thing of this world. So find it and grab it!
 
Old September 18th, 2004, 08:28 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

mmm, Lindsey's post had me thinking for a bout 3 1/2 minutes. As I'd never passed session vars into the body I didnt want to claim you absolutly could. Have tested this out of curiosity, as qazi_nomi said, this can be done without a problem.

Prabhakar_dt
The less lines of code on a page the better and use session vars sparingly.

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Sendmail.php How shall i? vinu123 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 January 5th, 2007 03:22 AM
SendMail Problem bahachin Excel VBA 0 November 22nd, 2006 09:45 AM
Sendmail datagram Classic ASP Components 5 April 10th, 2005 06:26 PM
Sendmail datagram Classic ASP Components 4 March 8th, 2005 08:21 AM
Using SendMail over ASP Paleo Classic ASP Components 1 July 29th, 2003 01:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.