Hi to all,
I
have an webform in asp.net with c# application. I had created on
stylesheet also. I called the stylesheet class for the textbox control.
So whatever I entered in that textbox, the style has applied. Then I
had used that textbox as a subject to send the email. Email
functionalities are working fine. But received mail cannot applied for
Stylesheet. I need to apply all the styles whatever i had created.
Can anyone tell me the solution for this. Waiting for ur valuable reply.
by,
sundar.
Loading
Niradhip ChakrabortyPosted Dec 1, 2008, 1:24 AM
Stylesheet class will not work in mail.you can add style tag in the html tag.
Try this:
private void SendMail()
{
string strHTML = "";
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
strHTML = strHTML + "
string strFrom = null;
strFrom = "[email protected]";
MailMessage mlMsgclient = new MailMessage(strFrom, txtEmail1.Text);
mlMsgclient.Subject = "write the subject here";
mlMsgclient.Body = strHTML;
mlMsgclient.IsBodyHtml = true;
SmtpClient emailtoClient = new SmtpClient();
emailtoClient.Send(mlMsgclient);
}