Link to home
Start Free TrialLog in
Avatar of rcowen00
rcowen00Flag for United States of America

asked on

CreateUserWizard MailDefinition

I have the MainDefinition set up as follows in CreateUserWizard and I am not getting the emails?  Any suggestions?  Thanks

<MailDefinition From="No-Reply@myproval.com" 
                Subject="Welcome to TCV (Transcontinental Valuations)" 
                BodyFileName="../EmailNotifications/Welcome.txt">
            </MailDefinition>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rcowen00

ASKER

I have the maildefinition in the properties of the CreateUserWizard and I have this in my code behind

Protected Sub CreateUserWizard_SendingMail1(sender As Object, e As System.Web.UI.WebControls.MailMessageEventArgs)
        ' Set MailMessage fields.
        e.Message.IsBodyHtml = False
        e.Message.Subject = "New user on Web site."
        ' Replace placeholder text in message body with information 
        ' provided by the user.
        e.Message.Body = e.Message.Body.Replace("<%PasswordQuestion%>", CreateUserWizard.Question)
        e.Message.Body = e.Message.Body.Replace("<%PasswordAnswer%>", CreateUserWizard.Answer)
    End Sub

Open in new window

Does it fire this event?
It doesn't appear to
Do you have

onsendingmail="Createuserwizard_SendingMail1"

in properties?
Yes
I'm going to rebuild the page.
Follow up:  I did not need to re-create the page.  It turns out that I had a redirect in the code behind so the email wasn't being sent.  Thanks!
Glad its sorted :-)