I have a passwordRecovery control and a custom text file which contains the Body of the email. I get the email fine if I specify the File name at design time in the MailDefinition of the PasswordRecovery control:
<MailDefinition From="info@Intamac.com" Subject="Your New Password" BodyFileName="PasswordMail.txt">
However I need to set the Text file at runtime based on the users current theme. I have tried to do this in the PasswordRecovery's sendingMail event but this just sends the default email out. ie (doesn't apply the text file) here's what i'm doing:
Protected Sub PswdRecovery_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles PswdRecovery.SendingMail
Me.PswdRecovery.MailDefinition.BodyFileName = "PasswordMail.txt"
The text file is in the same dir as the page so this isn't the problem. Any ideas?