I have set up a website with a simple register/log in form. What i want is when a user registers in my site, an email with the details of that user to be sent to my email address.
Below is the code that generates some of the text boxes of the “Register” form:
<asp:TextBox ID="Username" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:TextBox ID="Address" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:TextBox ID="Email" runat="server" CssClass="textEntry"></asp:TextBox>
I want the content of these text boxes to be sent to me.
I managed to send emails from my site, using System.Net.Mail.SmtpClient class but i am getting confused with the syntaxt of it because i want the address:
MailAddress to = new MailAddress("user@domain.com")
to be always the same(mine) but the content of the email to change depending on what every user types in the text boxes.
I am a new to development and i am trying to work this specific issue out for quite some time so any guidance would be of great aid to me.If i am not specific enough, please let me know if you need more information about my issue.
Thanks in advance.
Try with following code: