Forum
Repeater daki bilgilari yani belirledigim alanları mail atmam mümkünmüdür acaba??
Repeater içindeki bilgilere buton altından ulaşmak için foreach kullanmanızı tavsiye ederim.
foreach(RepeaterItem item in repeater1.items)
{ ... }
teşekkurler oldu sonun da
yaptığınız örneği bizimle paylaşırsanız sevinirim
Umarım işine Yarar..
StringBuilder sb = new StringBuilder();
sb.Append("<table style='font-size:10pt; font-family:Arial;'><tr><td style='background-color:#0d9ff2; font-weight:bolder; Height:25px; Color:#fff; padding:5px;'>Parça Numarası</td><td style='background-color:#0d9ff2; font-weight:bolder; Height:25px; Color:#fff; padding:5px;' >Fiyatı</td><td style='background-color:#0d9ff2; font-weight:bolder; Height:25px; Color:#fff; padding:5px;'>Birimi</td><td style='background-color:#0d9ff2; font-weight:bolder; Height:25px; Color:#fff; padding:5px;' >Adet</td><td style='background-color:#0d9ff2; font-weight:bolder; Height:25px; Color:#fff; padding:5px;' >Kdv Dahil Top.</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>" );
foreach (RepeaterItem item in RepeaterSepetDetay.Items)
{
Label Baslik = item.FindControl("Baslik") as Label;
Label Marka = item.FindControl("Marka") as Label;
Label Aciklama = item.FindControl("Aciklama") as Label;
TextBox Adet = item.FindControl("Adet") as TextBox;
Label ListeFiyati = item.FindControl("ListeFiyati") as Label;
Label ParaBirimi = item.FindControl("ParaBirimi") as Label;
Label IndirimOrani = item.FindControl("IndirimOrani") as Label;
Label Tutar = item.FindControl("Tutar") as Label;
sb.AppendFormat("<tr><td style='font-size:8pt; font-family:Arial;' >{0}</td>", Baslik.Text);
sb.AppendFormat("<td style='font-size:8pt; font-family:Arial;' >{0}</td>", Marka.Text);
sb.AppendFormat("<td style='font-size:8pt; font-family:Arial;' >{0}</td>", Aciklama.Text);
sb.AppendFormat("<td style='font-size:8pt; font-family:Arial;' >{0}</td>", Adet.Text);
sb.AppendFormat("<td style='font-size:8pt; font-family:Arial;' >{0}</td>", ListeFiyati.Text);
sb.AppendFormat("<td style='font-size:8pt; font-family:Arial;' >{0}</td>", ParaBirimi.Text);
sb.AppendFormat("<td style='font-size:8pt; font-family:Arial;' >{0}</td>", IndirimOrani.Text);
sb.AppendFormat("<td style='font-size:8pt; font-family:Arial;' >{0}</td>", Tutar.Text);
}
sb.Append("</table>");
MailMessage mailMessage = new MailMessage("from@fromcom", "[email protected]");
mailMessage.Subject = "Başlık";
mailMessage.Body = sb.ToString();
mailMessage.IsBodyHtml = true;
SmtpClient smtpClient = new SmtpClient("mail.xxxxxx.com", 587);
smtpClient.Send(mailMessage);