We are having an issue whereby we create a MapiMessage from an existing .msg file and set the subject line. That file is saved back to the filesystem and then open Outlook via Process.Start(msg file).
Outlook opens OK and displays the message OK. We then enter the ‘To’ address manually and add anything else to the body that the user might want to - all good.
But when we press Send, we get a Microsoft Outlook message stating ‘Could not complete the operation because the service provider does not support it’. There are no errors in the event log to shed more light on this. I am assuming that doing it this way, the ‘from’ is already set and determined via my outlook account, but I also tried setting ‘SenderEmailAddress’ and ‘SenderName’ and that made no difference.
The .msg file we use as a template for creating the message was create from inside Outlook by just clicking ‘New Email’. That message is then saved to a folder by click ‘File > Save As’ on the email and then setting the path.
I should note that this Outlook inbox is coming from a google-synced google mail account and I am using Outlook 365 (have also tested on other versions of Outlook). Perhaps we can’t use the MapiMessage type for this?
See the code below:
var mailMessage = MapiMessage.FromFile(@“c:\temp\template.msg”);
mailMessage.Subject = “My subject”;
string outputMsg = @“c:\temp\output.msg”;
using (var msgStream = new FileStream(outputMsg, FileMode.Create, FileAccess.ReadWrite))
We were using Aspose.Email v220.127.116.11 but have also tried the same test in v18.104.22.168 and get the same results.
I also tried create the email from scratch using aspose.email instead of using the presaved file but that also failed.
Any help appreciated.