I am doing a CLR procedure of sending mail, I have composed the html into my string , After binding some dynamic values I have been able to send mail.
But Now the issue is , I am getting a string which containing the HTML, So I want to find the first <table> and then change its width. it.[Due to large width the template is disturbing]. This is the body of the email.
string StrHtml =" <table cellspacing='1' cellpadding='10' border='0'
style='width:880px'></table>"
I want to change the style='width:880px' to style='width:550px'
I am doing this code only in class library. what is the best way to do this?
My Code is :
string ImgPath = string.Empty;
ImgPath = Convert.ToString(ds.Tables[0].Rows[i]["GroupMessage"]);
string pattern = string.Empty;
pattern = System.Text.RegularExpressions.Regex.(ImgPath, "(<table.*?>.*</table>", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Groups[1].Value;
MailMessage message = new MailMessage();
message.AlternateViews.Add(htmlMail);
message.Body = ImgPath ; //
message.IsBodyHtml = true;
//Other mail sending code here.....
styleattribute only ever contain awidthparameter?