New Email Message to prompt at a click

osl

Member
Joined
Jun 8, 2006
Messages
20
Programming Experience
5-10
Hi,
I'm stuck at getting a new email message to prompt when click on 'Forgot your password?' on a webform.

The below codes worked but they are hardcoded. Any idea on how to just get a new Message prompt for user to input and then send it out manually?


VB.NET:
Dim email As New System.Web.Mail.MailMessage()
email.To = "RecipientAddress"
email.From = "SenderAddress"
email.Body = "MessageText"
email.Subject = "SubjectText"
email.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "SmtpServerName"
System.Web.Mail.SmtpMail.Send(email)

Thank you in advance!

OSL
 
Last edited by a moderator:
You should do it on a new page, and provide text boxes for the user input.

Then you use code like
VB.NET:
Dim email As New System.Web.Mail.MailMessage()
email.To = "RecipientAddress" 'This is hard Coded - no user input needed
email.From = FromAddress.text ' Pulls the value from the texbox 'FromAddress'
email.Body = MessageText.Text
email.Subject = SubjectText.Text
email.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "SmtpServerName"
System.Web.Mail.SmtpMail.Send(email)
Alternatively, you could put all the controls on a panel, and only make it visible when the forgot password link is clicked.
 
Hi,
I never thought of fetch data from a form. I was thinking of direct to new email message when click at 'forgot your password'.
Thank you for sharing the idea.

osl
 
Back
Top