hi
I used gridview in page and I used code to send email :
gridview:
<asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField ItemStyle-Width="24px" ItemStyle-VerticalAlign="Middle">
<ItemTemplate>
<asp:HyperLink ID="HPtemporary" runat="server" NavigateUrl='<%#Eval("DownLoadToken","http://Site.com/downloads/{0}")%>'>'<%#Eval("DownLoadToken","http://site.com/downloads/{0}")%>'</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
AND:
protected void SendEmail()
{
string body = this.PopulateBody(LblUsername.Text,
"شماره پیگیری" + Lblrefid.Text);
this.SendHtmlFormattedEmail("Email@gmail.com", "شماره پیگیری", body);
}
private string PopulateBody(string userName, string description)
{
string body = string.Empty;
using (StreamReader reader = new StreamReader(Server.MapPath("~/EmailTemplate.htm")))
{
body = reader.ReadToEnd();
}
body = body.Replace("{UserName}", userName);
body = body.Replace("{Description}", description);
return body;
}
now here In this line:
string body = this.PopulateBody(LblUsername.Text,"شماره پیگیری" + Lblrefid.Text);
instead of Lblrefid.text I want put it send all row of grid view to email:
<asp:HyperLink ID="HPtemporary" runat="server" NavigateUrl='<%#Eval("DownLoadToken","http://Site.com/downloads/{0}")%>'>'<%#Eval("DownLoadToken","http://site.com/downloads/{0}")%>'</asp:HyperLink>
how I can do it?
Best regards
neda