Emailing html page
-
Dear All, I would like to send emails to the clients in accordance with their choice (shopping), I would like it to be formatted, so I thought of HTML body however, it seems difficult to convert gridview datasource to HTML, Is there any easy way to reach the HTML source of a page and assign it to an HTML Text. Thanks alot. Below you may see a samle page to be sent. <table style="margin-left:auto; margin-right:auto; position:relative;"> <tr> <td> <div id="centrallarge"> <h1 style="height:85px; width:900px;"><img src='http://www.salatabufesi.com/images/SalataPage.jpg' alt="Salata"/> </h1> <h1 style="height:45px; width:900px;"><img src='http://www.salatabufesi.com/images/SalataBufesi.jpg' alt="Salata Büfesi"/> </h1> </div> </td> </tr> <tr> <td> <div id="central" style="height:400px; margin-top:30px;"> <table id="Tablo" style="margin-left:auto; margin-right:auto; position:relative;"> <tr id="Satir1" style="height:25px; vertical-align:top;"> <td width="901" id="Sutun1"> <span id="lblAciklama" style="color:Red;font-family:Tahoma;">Siparişiniz elimize ulaşmıştır</span> </td> </tr> <tr style="height:25px; vertical-align:top;"> <td> <span id="lblOnMusteri" style="color:Red;font-family:Tahoma;">Sipariş Adresi: </span> <span id="lblMusteri" style="font-family:Tahoma;">İstasyon Cad Nuriye Hnm Apt No:17/14 .</span> </td> </tr> <tr style="height:25px; vertical-align:top;"> <td> <span id="lblOnOdeme" style="color:Red;font-family:Tahoma;">Ödeme Şekli: </span>
-
Dear All, I would like to send emails to the clients in accordance with their choice (shopping), I would like it to be formatted, so I thought of HTML body however, it seems difficult to convert gridview datasource to HTML, Is there any easy way to reach the HTML source of a page and assign it to an HTML Text. Thanks alot. Below you may see a samle page to be sent. <table style="margin-left:auto; margin-right:auto; position:relative;"> <tr> <td> <div id="centrallarge"> <h1 style="height:85px; width:900px;"><img src='http://www.salatabufesi.com/images/SalataPage.jpg' alt="Salata"/> </h1> <h1 style="height:45px; width:900px;"><img src='http://www.salatabufesi.com/images/SalataBufesi.jpg' alt="Salata Büfesi"/> </h1> </div> </td> </tr> <tr> <td> <div id="central" style="height:400px; margin-top:30px;"> <table id="Tablo" style="margin-left:auto; margin-right:auto; position:relative;"> <tr id="Satir1" style="height:25px; vertical-align:top;"> <td width="901" id="Sutun1"> <span id="lblAciklama" style="color:Red;font-family:Tahoma;">Siparişiniz elimize ulaşmıştır</span> </td> </tr> <tr style="height:25px; vertical-align:top;"> <td> <span id="lblOnMusteri" style="color:Red;font-family:Tahoma;">Sipariş Adresi: </span> <span id="lblMusteri" style="font-family:Tahoma;">İstasyon Cad Nuriye Hnm Apt No:17/14 .</span> </td> </tr> <tr style="height:25px; vertical-align:top;"> <td> <span id="lblOnOdeme" style="color:Red;font-family:Tahoma;">Ödeme Şekli: </span>
System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); GridView1.RenderControl(htmlWrite); This might help.
Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif
-
System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); GridView1.RenderControl(htmlWrite); This might help.
Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif
good answer it seems exactly what I need. thanks