Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 9th, 2013, 11:09 PM
Authorized User
Points: 353, Level: 6
Points: 353, Level: 6 Points: 353, Level: 6 Points: 353, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 86
Thanks: 20
Thanked 3 Times in 3 Posts
Default Email in CreateUserWizard

Hi Imar,

On page 619 you explain how to use CreateUserWizard to send an email to the newly registered user. The example works very well (thank you). However, I wanted an additional email sent to me whenever someone creates a user account on my website. It seemed like this should be easy because the MailDefinition has a CC subproperty. However CC just shows another email address on the users email - it doesn't actually send another email. At least this was my experience with CC. Is there actually a way to use CC so it sends out another email? I have a work around (see below) but this CC behavior seems odd.

<asp:CreateUserWizard ID="CreateUserWizard1" oncreateduser="CreateUserWizard1_CreatedUser" runat......


• Imports System.Net.Mail
• Partial Class SignUp
• Inherits System.Web.UI.Page
• Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs)

• Dim mymessage As MailMessage = New MailMessage()
• Dim BodyText As String
• BodyText = CreateUserWizard1.Email + " " + CreateUserWizard1.UserName

• mymessage.Subject = "New User"
• mymessage.Body = BodyText
• mymessage.From = New MailAddress("you@domain.com", "You")
• mymessage.To.Add(New MailAddress("someone@domain.com", "Someone"))

• Dim mySmtpClient As SmtpClient = New SmtpClient()
• mySmtpClient.Send(mymessage)
• End Sub
Reply With Quote
  #2 (permalink)  
Old July 10th, 2013, 03:30 AM
Authorized User
Points: 42, Level: 1
Points: 42, Level: 1 Points: 42, Level: 1 Points: 42, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2013
Location: New York
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is quite an information..thanks for sharing that..
__________________
REI Coupon
Reply With Quote
  #3 (permalink)  
Old July 10th, 2013, 03:56 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

CC stands for Carbon Copy which means the exact same message is sent to another address. This means that the user that signed up and your account should receive an exact copy of the e-mail. If you only see one message in your Inbox, you may be using the same address and your mail server or client may only show one.

If you want to send a different message, with a different body and subject, your solution makes perfect sense and is not odd at all.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #4 (permalink)  
Old July 10th, 2013, 10:00 AM
Authorized User
Points: 353, Level: 6
Points: 353, Level: 6 Points: 353, Level: 6 Points: 353, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 86
Thanks: 20
Thanked 3 Times in 3 Posts
Default Same Address

Quote:
Originally Posted by Imar View Post
you may be using the same address and your mail server or client may only show one.
Imar
As usual, you're correct. I must have been testing with the same address and the mail server decided to send just one email. When I used two completely different addresses it worked as advertised.

I'm going to keep my "work around" solution in this case as the email sent to the new user shows the user name and password the user has registered with. The user, seeing a CC to someone else (even the website administrator) with that password exposed, might raise security concerns.

Thanks for clearing up this puzzle.
Reply With Quote
  #5 (permalink)  
Old July 10th, 2013, 05:50 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

>> . The user, seeing a CC to someone else (even the website administrator) with that password exposed, might raise security concerns.

Yep, that makes sense. And now you a solution where you can provide different content to administrators, such as a link to approve the account (for cases where the account isn't immediately activated at creation time).

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
daveharney (July 10th, 2013)
  #6 (permalink)  
Old August 4th, 2013, 03:46 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default crystal reports

Hello! guys I'm going to introduce you a great site of crystal reports. Actually Crystal reports is a kind of system to create reports in easier and automatic form. This site gives you complete information and knowledge about crystal reports. So go to the site http://www.christiansteven.com/solutions/crd and get all information. This is a great site and can help you for making any kinds of reports.

Thank You!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CreateUserWizard Confirmation Email Error ClarkNaylor ASP.NET 4 General Discussion 3 July 30th, 2010 01:07 PM
email validation doesn't work in CreateUserWizard hertendreef ASP.NET 2.0 Professional 0 February 20th, 2008 01:20 PM
CreateUserWizard AghaKhan ASP.NET 2.0 Professional 1 December 5th, 2007 08:14 PM
CreateUserWizard michaelcode ASP.NET 2.0 Basics 1 August 19th, 2006 09:04 AM
CreateUserWizard zoltac007 ASP.NET 2.0 Basics 4 June 1st, 2006 04:08 PM



All times are GMT -4. The time now is 07:45 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.