473,670 Members | 2,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET 2 - how can I embed variables in an email body text file

Hello,

I am using ASP.NET 2 and using the CreateUserWizar d I am wanting an
email to go out to the new user informing them of their account details
etc...

I have a BodyFileName in the MailDefinition section of the
CreateUserWizar d component and have that currently pointing to a simple
text file where I want to embed the account detail variables and email
text.

I have read on a website that you can use embedded variables, such as
<% UserName %> which obviously displays the username and which I have
had working, but I can't find anything anywhere else that tells me what
the other default available variables are or ideally, how I can define
and add my own.

There are ways around this by dynamically creating the email text in
code, but I would really like to use the embeded variables as I think
this will be easier in the long run.

Any help would be much appreciated.

Many thanks in advance.

Cheers
Mark...

Mar 21 '06 #1
2 3294
I've built a mail merge in ASP and its not too difficult.
These <% ... %> are called "Code Blocks" or "Render Blocks" [1,2]

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URL http://clintongallagher.metromilwaukee.com/

[1]
http://samples.gotdotnet.com/quickst....aspx#usingasp
[2] http://msdn2.microsoft.com/en-US/library/ms178135.aspx
"Mark1249" <ma**@email2han d.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
Hello,

I am using ASP.NET 2 and using the CreateUserWizar d I am wanting an
email to go out to the new user informing them of their account details
etc...

I have a BodyFileName in the MailDefinition section of the
CreateUserWizar d component and have that currently pointing to a simple
text file where I want to embed the account detail variables and email
text.

I have read on a website that you can use embedded variables, such as
<% UserName %> which obviously displays the username and which I have
had working, but I can't find anything anywhere else that tells me what
the other default available variables are or ideally, how I can define
and add my own.

There are ways around this by dynamically creating the email text in
code, but I would really like to use the embeded variables as I think
this will be easier in the long run.

Any help would be much appreciated.

Many thanks in advance.

Cheers
Mark...

Mar 22 '06 #2
Hi Clinton,

Thank you very much for your response.

The thing I was talking about in my original email were not code render
blocks (unless I am wong, which could be very likely), they are
actually tags that insert data into the email text (very similar to a
Word Mail Merge etc...).

In asp.net 2 I have created a site with Forms authentication which
includes profiles for capturing First Name and Last Name etc.., and
want to customise the standard emails that you can set to be sent once
a new user registers or resets their password etc... and I read
somwhere that you can customise this email text, however with something
like the password recovery email it needs to be able to send the user
their new password along with the customised text. I have managed to
do this using the tag "<% Password %>" and in the new user email I can
send the new user a reminder of what their password is by including the
tag "<% Username %>". Manybe these are considered code blocks, but my
understanding is that code blocks are for use in HTML and start with
"<%=" rather than "<%" rather than for use in a text file for the
purpose of customising the emails.

My question is that I am wondering what other "<% xxxx %>" tags are
available and also how I can use these tags to put in some of my
profile data such as First Name and Last Name?

Any help would be much apreciated as I could write a customised email
compiler, but I really want to use as much of the in-built asp.net
tools as I can.

Looking forward to your response.

Regards
Mark...

Mar 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3175
by: Mike Wilcox | last post by:
I have the following two files used to insert data into a database. when meinsert.php is executed a blank record is inserted in the database as if the .php file is not receiving the variables. Any ideas why this might be happening? Environment is stock RH9 with no updates. I believe it is PHP 4.2.2 and Apache 2.0.40. Thanks, Mike
6
11276
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
2
14387
by: Siv | last post by:
Hi, I have written an application which is used by sales staff when discussing products with their customers over the phone. It is a database application that holds detailed information about their products including pictures to assist the sales staff describe features to the customer. The next step in development of the app is to have a button when in a particular product screen that the seller can press which sends the customer an...
24
6256
by: Manuel | last post by:
Is it possible to embed an image, like a company logo in a CDOSYS generated message? If yes, I´ll apreciate some code sample. I´ve been able to format messages in html the way I like, but I can't figure out how to embed an image. Thanks for your time. -- Manuel
1
2589
by: Santosh | last post by:
Dear All i am writting a code sending mail with attachement. i am writting code for sending mail in one page and code for attaching a file in the next page. aftet attaching a file i am taking name of that file from attaching file page to email page through in session file .i am giving a facility of attaching five files to user . and i am taking names of both files in session variables but user attach less than five five
6
1850
by: christopher.j.just | last post by:
I need to set the information being passed through the fields (23 of them) in the form into a session. Where do I start? Thanks, Chris
3
4789
by: abrtlt | last post by:
I would like to have a web page in which, when the user clicks on any of several specific elements, a specific audio file is played, without reloading the page. The specific audio file name is obtained from a PHP script (accessing a MySQL database) that could be called using XMLHttpRequest and JavaScript would write in a "div" tag an "embed and play" HTML tag containing the audio file name. I am not sure this would work, as the embed tag...
19
5631
by: ginahong | last post by:
Hi, I'm new with perl. I'm writting a perl script to read a text file to email the contract managers to warn them there are some contracts with High risks waiting for them to view. The text file includes "Email_address", "Manager_Name","url_link",etc. The result format is a list of contract numbers in the email body. e.g. CONTRACT NO 020221021 970040006
0
1725
by: =?Utf-8?B?TWFyazEyMw==?= | last post by:
I have two pieces of VB.NET code below: a) Sends an email b) Returns a programmatically created jpeg image to a webpage. How can I embed the programmatically created jpeg into an HTML formatted email (without saving the jpeg to disk)? Code a) ======
0
8384
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8896
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8590
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7410
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6211
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4387
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2798
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1790
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.