 |
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
|
|
|
|

July 9th, 2013, 11:09 PM
|
Authorized User
|
|
Join Date: Dec 2011
Posts: 86
Thanks: 20
Thanked 3 Times in 3 Posts
|
|
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
|

July 10th, 2013, 03:30 AM
|
Authorized User
|
|
Join Date: Jun 2013
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
That is quite an information..thanks for sharing that..
|

July 10th, 2013, 03:56 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

July 10th, 2013, 10:00 AM
|
Authorized User
|
|
Join Date: Dec 2011
Posts: 86
Thanks: 20
Thanked 3 Times in 3 Posts
|
|
Same Address
Quote:
Originally Posted by Imar
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.
|

July 10th, 2013, 05:50 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> . 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
|
The Following User Says Thank You to Imar For This Useful Post:
|
|

August 4th, 2013, 03:46 AM
|
Registered User
|
|
Join Date: Aug 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|
|
 |
|