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("
[email protected]", "You")
⢠mymessage.To.Add(New MailAddress("
[email protected]", "Someone"))
â¢
⢠Dim mySmtpClient As SmtpClient = New SmtpClient()
⢠mySmtpClient.Send(mymessage)
⢠End Sub