How to apply stylesheet class in EMail HTML format
-
I want to apply stylesheet to the HTML format of mail. I dont want to use code like : string strBody=""; strBody += "
Hi,"; strBody += "
"; Instead of that want to use : string strBody=""; strBody += "
Hi,"; strBody += "
"; ObjMail.BodyFormat=MailFormat.Html; ObjMail.Body=strBody; Is it possible to use what I expected??
-
I want to apply stylesheet to the HTML format of mail. I dont want to use code like : string strBody=""; strBody += "
Hi,"; strBody += "
"; Instead of that want to use : string strBody=""; strBody += "
Hi,"; strBody += "
"; ObjMail.BodyFormat=MailFormat.Html; ObjMail.Body=strBody; Is it possible to use what I expected??
Deepml wrote:
Instead of that want to use : string strBody=""; strBody += "
Hi,"; strBody += "
"; ObjMail.BodyFormat=MailFormat.Html; ObjMail.Body=strBody;
Did you check it? How it will get
class='verdanaText'
. You have to write the cssclass also with the BodyString.cheers, Abhijit CodeProject MVP
-
Deepml wrote:
Instead of that want to use : string strBody=""; strBody += "
Hi,"; strBody += "
"; ObjMail.BodyFormat=MailFormat.Html; ObjMail.Body=strBody;
Did you check it? How it will get
class='verdanaText'
. You have to write the cssclass also with the BodyString.cheers, Abhijit CodeProject MVP
-
Abhijit Can you please tell me how to write that cssClass with Bodystring,I mean how to write
Deepml wrote:
mean how to write
Not, its not like that. I want to mean, Create a mail content file like .FontHeaderStyle { font-size: 12px; font-family: verdana; color:#C41230; }
This is Sample HTML Mail
Now, read the content as Text Reader and put it in mail body. Hope this is not clear to any. Any doubts ? cheers, Abhijit CodeProject MVP
-
Deepml wrote:
mean how to write
Not, its not like that. I want to mean, Create a mail content file like .FontHeaderStyle { font-size: 12px; font-family: verdana; color:#C41230; }
This is Sample HTML Mail
Now, read the content as Text Reader and put it in mail body. Hope this is not clear to any. Any doubts ? cheers, Abhijit CodeProject MVP
-
Go ahead. :thumbsup:
cheers, Abhijit CodeProject MVP