Hi, I am using Aspose.Email for Outlook reminder and it throwing below error
System.TypeInitializationException: 'The type initializer for ‘#=zCMIThOB2qmvZFW_Ifh4QKFf70WB9CEe4Rw==’ threw an exception
Inner Exception
NotSupportedException: No data is available for encoding 860. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
My Code is:
body.Clear();
List data = new List();
data = list.Select(x => x).Where(x => x.ContactDate == item).ToList();
DateTime RemindDate = DateTime.UtcNow;
body.Append("<html><body>");
foreach (var obj in data)
{
body.Append("<ul style='list-style-type: square;'>");
body.Append("<li>Client Name : " + obj.ClientName + "");
body.Append("<br>Candidate Name : " + obj.CandidateName + " (" + obj.RefNo + ") " + "");
body.Append("<br>Check Name :" + obj.CheckName);
body.Append("<br>Contact Date : " + obj.ContactDate + "");
body.Append("<br>Reason : " + obj.Reason + "");
body.Append("</li><br />");
body.Append("</ul>");
}
body.Append("</body></html>");
Aspose.Email.License license = new Aspose.Email.License();
license.SetLicense("Aspose.Total.lic");
DateTime EndTime = DateTime.Parse(item).Date.Add(new TimeSpan(23, 59, 00)).ToUniversalTime();
var contact_date = DateTime.Parse(item).Date;
if (contact_date < DateTime.Now.Date)
{
RemindDate = DateTime.Parse(item);
}
var enc = CodePagesEncodingProvider.Instance.GetEncoding(1252);
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Aspose.Email.Calendar.Appointment app = new Aspose.Email.Calendar.Appointment("HK", RemindDate.ToUniversalTime(), EndTime, "support@abc.com", supervisorEmail);
app.Summary = "Future employment check reminder from [" + RemindDate.ToString("dd-MM-yyyy") + "] to [" + EndTime.ToString("dd-MM-yyyy") + "]";
app.MethodType = AppointmentMethodType.Publish;
Aspose.Email.MailMessage msg = new Aspose.Email.MailMessage("support@abc.com",supervisorEmail);
msg.HtmlBody = body.ToString(); //Setting Email Body.
msg.IsBodyHtml = true; //Setting Email Body type HTML.
msg.PreferredTextEncoding = Encoding.GetEncoding(1252);
Aspose.Email.AlternateView view = app.RequestApointment();
msg.AddAlternateView(view);
//msg.To = supervisorEmail;
//msg.From = "support@abc.com";
//var enc = CodePagesEncodingProvider.Instance.GetEncoding("UTF8");
//Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
//Stream str = new MemoryStream();
//msg.Save(str);
MapiConversionOptions conversionOptions = new MapiConversionOptions();
conversionOptions.Format = OutlookMessageFormat.Unicode;
conversionOptions.ForcedRtfBodyForAppointment = false;
Aspose.Email.Mapi.MapiMessage mapi = Aspose.Email.Mapi.MapiMessage.FromMailMessage(msg,conversionOptions);//error throws here
Aspose.Email.Mapi.MapiCalendar calendar = (Aspose.Email.Mapi.MapiCalendar)mapi.ToMapiMessageItem();
calendar.ReminderSet = true;
calendar.ReminderDelta = 1;
Can please help to solve the issue