Hello All,
I have one query.
I have a webform with some fields and a command button say sendmail.What i want to do is that whenever a user click on sendmail a mail should have to go to perticular emailid with all fields in the webform and in a tabular format.i.e. all the data in the mail must be display in the form of table.Please anybody send me the code its hurry for me.
My email ids are
Thanks & Regards
Prashant S. More
Niradhip ChakrabortyPosted May 19, 2008, 6:31 PM
Page Having following field.
Name:TextBox(txtCName.Text)
Phone: TextBox(txtCphone.Text)
E-mail: TextBox(txtCmail.Text)
Comments:TextBox(txtCcomments.Text)
protected void btnSubmit_Click(object sender, EventArgs e)
{
//Mail to Company
string strHTML = null;
strHTML = "";
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + " Request for the Information: ";
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "";
strHTML = strHTML + "";
try
{
//sending mail to client
MailMessage mlMsgclient = new MailMessage(strFrom, txtCmail.Text);
mlMsgclient.Subject = "Request submission confirmation";
mlMsgclient.Body = strHTML;
mlMsgclient.IsBodyHtml = true;
SmtpClient emailtoClient = new SmtpClient();
emailtoClient.Send(mlMsgclient);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
}
}
Prashant MorePosted May 19, 2008, 8:39 AM
Hello Nipun,
Thanks for your reply.But my problem is not solved you send me the code for how to send mail and i need the code for how to send the textbx values of the form to the mail in the tabular form.Please send me that HTML code and how to attach it to aspx.cs file.
Thanks & Regards
Prashant S. More
Nipun TomarPosted May 15, 2008, 1:30 AM