Wrox Programmer Forums
|
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 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 July 9th, 2013, 11:09 PM
Authorized User
 
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
 
Old July 10th, 2013, 03:30 AM
Authorized User
 
Join Date: Jun 2013
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is quite an information..thanks for sharing that..
__________________
REI Coupon
 
Old July 10th, 2013, 03:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old July 10th, 2013, 10:00 AM
Authorized User
 
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.
 
Old July 10th, 2013, 05:50 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
The Following User Says Thank You to Imar For This Useful Post:
daveharney (July 10th, 2013)
 
Old August 4th, 2013, 03:46 AM
Registered User
 
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!





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





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