MVC projenizde rotativa kullanan varsa başına gelmiş olabilir diye konuyu açmak istedim.
Yazılımımda bir form kaydı işlemi sonrası detaylı bilgileri PDF olarak gönderiyorum. Localde problemsiz çalışırken hosting de çalıştırmaya kalktığım zaman hata ile karşılaşıyorum...
#region PDF OLARAK MAİL GÖNDERME İŞLEMLERİ
var pdfResult = new ViewAsPdf("davetiyeOnay", yeniKayit) { FileName = pdfBaslik + yeniKayit.kod + ".pdf" };
var binary = pdfResult.BuildPdf(this.ControllerContext);
MemoryStream memoryStream = new MemoryStream(binary);
MailMessage message = new MailMessage();
Attachment attachment = new Attachment(memoryStream, pdfBaslik + yeniKayit.kod + ".pdf", MediaTypeNames.Application.Pdf);
if (mailSablon.gizliMaill != null)
{
string[] bccid = mailSablon.gizliMaill.Split(',');
foreach (string bccEmailId in bccid)
{
message.Bcc.Add(new MailAddress(bccEmailId));
}
}
SmtpClient smtp = new SmtpClient(mailSmtp, mailPort);
smtp.EnableSsl = false;
smtp.Credentials = new NetworkCredential(mailAdres, mailParola);
message.Attachments.Add(attachment);
message.Body = mailSablon.icerik;
message.Subject = mailSablon.konu;
message.IsBodyHtml = true;
message.From = new MailAddress(mailAdres, mailSablon.ad);
message.To.Add(yeniKayit.email);
smtp.Send(message);
#endregionYukarıda ki şekilde mail gönderme işlemini sunucuda yaparken aldığım hata aşağıda ki gibidir;Unhandled Execution Error
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception:
İnşallah bir bilen fikri olan çıkar.
İyi forumlar.