Follow along with the video below to see how to install our site as a web app on your home screen.
Not: This feature may not be available in some browsers.
try
{
MailMessage mesaj = new MailMessage();//mail nesnesi
mesaj.From =
new MailAddress("gönderilecek adres", "Başlık", System.Text.Encoding.UTF8);
SmtpClient smtp = new SmtpClient();
//mesaj.To.Add("alıcı adresi");
mesaj.Subject =
"Mail başlığı";
AlternateView plainView = AlternateView.CreateAlternateViewFromString("alternate", null, "text/plain");
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("<img src=cid:companylogo>", null, "text/html");
LinkedResource logo = new LinkedResource("mail gövdesine eklenecek resim yolu");
logo.ContentId =
"companylogo";
htmlView.LinkedResources.Add(logo);
mesaj.AlternateViews.Add(plainView);
mesaj.AlternateViews.Add(htmlView);
mesaj.IsBodyHtml =
true;
smtp.Credentials =
new System.Net.NetworkCredential("gönderilecek mail adresi", "şifre");//kullanici adi ve sifre sicili
smtp.Port = 587;
smtp.Host =
"smtp sunucusu";
smtp.Send(mesaj);
}
catch (Exception ex)
{
MessageBox.Show("HATA! Gönderilemedi!");
}
bu galibaC# İşini görür umarım
Kod:AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content, viewable by those clients that don't support html", null, "text/plain"); AlternateView htmlView = AlternateView.CreateAlternateViewFromString("Here is an embedded image.<img src=cid:companylogo>", null, "text/html"); LinkedResource logo = new LinkedResource(@"C:\Users\Administrator\Desktop\DSC_0015.jpg"); logo.ContentId = "companylogo"; htmlView.LinkedResources.Add(logo); mesaj.AlternateViews.Add(plainView); mesaj.AlternateViews.Add(htmlView);
Kodların tamamını yeniledim şimdi