arşiv

0, 2016 için arşiv

Inline – Base64 Image Send Mail

Çarşamba, 24 Şub 2016 yorum yok
MailMessage oMailMessage = new MailMessage();

int PictureId = 1;
string ImgUrl = "Base64Data";
string cidPictureId = "picture" + PictureId;

byte[] data = System.Convert.FromBase64String(ImgUrl);
MemoryStream ms = new MemoryStream(data);

string htmlBody = "<h3>Mail Body İçereği</h3><img src=\"cid:" + cidPictureId + "\">";
AlternateView avHtml = AlternateView.CreateAlternateViewFromString(htmlBody, null, MediaTypeNames.Text.Html);

ms.Position = 0;
LinkedResource picture = new LinkedResource(ms) { ContentId = cidPictureId };
avHtml.LinkedResources.Add(picture);

oMailMessage.AlternateViews.Add(avHtml);

oMailMessage.From = new MailAddress("kalebasiyakup@gmail.com", "Yakup From");
oMailMessage.To.Add(new MailAddress("kalebasiyakup@gmail.com", "Yakup To"));
oMailMessage.Subject = "A picture using alternate views";
SmtpClient client = new SmtpClient("smtp.sunucu.com");
client.Send(oMailMessage);

 

Categories: C# Tags:

sp_send_dbmail – File attachment max size

Çarşamba, 24 Şub 2016 yorum yok

sp_send_dbmail – File attachment or query results size exceeds allowable value of 10000000 bytes. [SQLSTATE 42000] (Error 22050).  The step failed.

Hatasının çözümü "@query_result_no_padding = 1" yapmaktır.

Categories: SQL Hakkında Tags:

Fullcalendar – JavaScript Event Calendar

Salı, 16 Şub 2016 yorum yok
Categories: bestURL Tags: