Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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 May 19th, 2007, 10:53 AM
Friend of Wrox
 
Join Date: Apr 2006
Location: , , .
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with Maildefinition in CreateWizardUser

Hi,

I want to send the pasword with MailDefinition when someone creates an
account with CreateUserWizard control.
I defined a txt file with this:

Welcome new user, <br> <br>
Your password is: ##password## <br><br>
Follow this link: ##url## <br><br>
The e-team

The code-behind:
  e.Message.Body = e.Message.Body.Replace("##password##",
CreateUserWizard1.Password)
  e.Message.Body = e.Message.Body.Replace("##url##", "http://lwww..cc.vb")



When using property IsBodyHtml=true, the message looks good except that the
link is not clickable:

Welcome new user,
Your password is: xxxxxxxx
Follow this link: http://www.cc.vb
The e-team

When using property IsBodyHtml=false (and removing all <br>), the link is
clickable but the message is rendered as one line, like this:
 Welcome new user Your password is: xxxxxxxx Following this link:
http://www.cc.vb The e-team

Is it possible to have the linebreaks and the link clickable?
Thanks
H.


 
Old May 19th, 2007, 11:40 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Since the body of the message is HTML, you need to use plain HTML as well for the links:

Welcome new user, <br> <br>
Your password is: ##password## <br><br>
Follow this link: <a href="##url##">##url##</a> <br><br>
The e-team

Instead of the second ##url## you can also add text like Click here...

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old May 20th, 2007, 07:57 AM
Friend of Wrox
 
Join Date: Apr 2006
Location: , , .
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much

 
Old May 20th, 2007, 08:14 AM
Friend of Wrox
 
Join Date: Apr 2006
Location: , , .
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

i have one more problem about Maildefinition
It works, no problem, but i would like to add somethibg more: the name of the just created account.

Instead of "Welcome new user", i would like: "Welcome ##user##". I did this in code-behind:

Protected Sub CreateUserWizard1_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles CreateUserWizard1.SendingMail

e.Message.Body = e.Message.Body.Replace("##user##", User.Identity.Name)

But the account name doesn't appear in the mail (no error).

Do you know why?






Similar Threads
Thread Thread Starter Forum Replies Last Post
SMTP error in Chapter 4 - mailDefinition seetha_l BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 August 28th, 2008 02:25 PM
how to send the username with Maildefinition? hertendreef ASP.NET 2.0 Professional 2 May 24th, 2007 01:55 AM
problem with Maildefinition hertendreef ASP.NET 2.0 Professional 2 May 5th, 2007 12:54 PM





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