Im newbie here. Im creating a form that can be send it data to email when click submit. Im using C# as programming language.
Check wheter the coding that I keyin. Here is the coding.
Expand|Select|Wrap|Line Numbers
- MailMessage mail = new MailMessage(txtEmail.Text , "someone@gmail.com");
- mail.Subject = ddSubject.Text;
- mail.Body = "Name : " + txtName.Text +
- "<br /><br />Designation : " + txtDesignation.Text +
- "<br /><br />Organisation : " + txtOrganisation.Text +
- "<br /><br />Contact Number : " + txtDesignation.Text +
- "<br /><br />Facsimile: " + txtFax.Text +
- "<br /><br />Email : " + txtEmail.Text +
- "<br /><br />Subject : " + ddSubject.Text +
- "<br />Message : " + txtMsg.Text;
- SmtpMail.SmtpServer = "localhost";
- try
- {
- SmtpMail.Send(mail);
- lblConfirm.Text = "We thank you for your feedback/suggestion. Have a nice day!";
- }
- catch (Exception exc)
- {
- lblConfirm.Text = "Sorry your message not send due some technical problem. Please try again";
- }
Thanks,
Meshack