Hi, out web application generates a Mail Draft with the following coding:
MailMessage eml = new MailMessage();
AddAttachments(eml); //generates pdf-streams, append each stream as Attachment
MapiMessage msg = MapiMessage.FromMailMessage(eml);
msg.SetMessageFlags(MapiMessageFlags.MSGFLAGS_USENT);
MemoryStream stream = new MemoryStream();
msg.Save(stream);
context.Response.BinaryWrite(stream.GetBuffer());
stream.close();
Since years our Outlook-Clients run without activated Outlook-Cache and everthing was OK.
After the Outlook cache of some clients was activated last week, none of those clients can send the genereated Mail Drafts. A Security Error is thrown “You can not send a Mail in teh name of another User”. How can I prevent these Errors?
Thanks, Greetings from Germany
Rasputin
Hi Rasputin,
Hi Babar,
in our Environment we have the same Message and Cache Settings like those, shown in your attached Screen-Shot in your reply.
Does "investigative ticket" mean, that you check, weather the problem could be a wrong behaviour of the the classes in the aspose.dll when generating the msg-Stream?
Hi Rasputin,
Hi Babar,
we keep on trying here, wether there is a possibility to change the wrong behaviour by Exchange setting(s).
We found out, that our generated mails can be sent, when the User chooses the adress from the adressbook. "From" and "replayTo" must be filled by selecting from the adressbook (not by entering!). When an adress ist selected, the Mail is automatically authorized by Outlook. Otherwise not! We now try here the following, which I found in a german article:
Get-ReceiveConnector "Anonymous Relay" | Add-ADPermission -User "NT AUTHORITY\Authenticated Users" -ExtendedRights "Ms-Exch-SMTP-Accept-Any-Recipient" (https://www.mcseboard.de/ms-exchange-forum-80/exchange-2007-send-as-permission-funktioniert-130040.html)
So far we have no chance to get an entry authorized, which is entered manually.
Kind regards
Rasputin
Hi Rasputin,
Hi Babar,
Our Environment:
- Outlook 2003 SP3
- Exchange 2007
- Aspose.Network.dll for 3.5 (4.9.0.0) without any SP
We know now :-) about the default behaviour of Outlook.
With the inactive Cache before, Selections from the list weren't necessary.
So we diddn't know that there was a latent problem.
I will check, whether the latest assemblies automatically set the from field to AD.
If Mails than can be sent whitout this "Authorization-Step" against the Adressbook
everything will be OK! Our Users enter external Adresses or take them from the autocompletion-List.
They use the Adressbook too, but seldom.
I'l keep you informed.
Regards
Rasputin
Hi Babar,
I tried to change my Coding from Aspose.Network.Mail to Aspose.Email.Mail to check, if the Problem is solved with the latest assemblies.
How can the Draft-Mode be set, like I could do with Aspose.Network.Mail ? //msg2.SetMessageFlags(Aspose.Network.Outlook.MapiMessageFlags.MSGFLAG_UNSENT
Thanks, Regards
Rasputin
Aspose.Email.Mail.MailMessage msg = MailMessage.Load("Draft.msg", MessageFormat.Msg);
msg.TextBody = msg.Subject = "mySubject " + DateTime.Now.ToShortDateString();
foreach (MyAttachment myAtt in MyAttachments) {
MemoryStream aStream = GetStreamFrom(myAtt); //generates Type "application/pdf"
Aspose.Email.Mail.Attachment att = new Attachment(aStream, myAtt.fileName, myAtt.fileType);
msg.AddAttachment(att);
}
msg.Save(emailStream, Aspose.Email.Mail.MailMessageSaveType.OutlookMessageFormat);
context.Response.BinaryWrite(emailStream.GetBuffer());
emailStream.Close();
Hi Rasputin,
eml.Subject = “test”;
MapiMessage msg = Aspose.Email.Outlook.MapiMessage.FromMailMessage(eml);
msg.SetMessageFlags(Aspose.Email.Outlook.MapiMessageFlags.MSGFLAG_UNSENT);