Why does "on behalf of" appear in the From field of sent email items

We have an issue where we end up with “on behalf of” in the “From” field in sent items. What we do is create a MailMessage, add some html body, embed a linked resource, populate the to, sent fields. We then create the MapiMessage from the MailMessage, and set the SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT) so that we can save the message in the draft format. We then add the message to a zip file and send it to a recipient, who in turn opens the message from the zip file, checks the body of the message, and then hits send. But when you look in the sent items folder the message is flagged as being sent from “on behalf of”. Is there any way we can get the Outlook not behave like this when it is sending a message that has been created using the Aspose.Network dll.

Hi,

Thank you for inquiry.

I managed to reproduce this issue when Exchange Server is used as mail server. I have logged this bug (ID: 29609). We will look into it and will inform you when it gets fixed. Sorry for the inconvenience.

Hi there,

Have you had any success with coming up with a resolution to this issue?

Regards

Hi,

Sorry, we are still working on it. I will update you as soon as I have any news.

Hi,

Could you please try the following workaround?

Create an empty draft message using MS Outlook, save it in msg format (draft.msg). Use this file to edit in your code as below:

MapiMessage msg = MapiMessage.FromFile(“draft.msg”);

// add embedded attachment
msg.Attachments.Add(“companylogo”, File.ReadAllBytes(“aspose.png”));
MapiAttachment attach = msg.Attachments[0];
// set the content id property of the attachment
MapiProperty mapiProperty = new MapiProperty(MapiPropertyTag.PR_ATTACH_CONTENT_ID, Encoding.ASCII.GetBytes(“companylogo”));
attach.SetProperty(mapiProperty);

// HTML body
msg.SetBodyContent("


Bold text red text ", BodyContentType.Html);

// set necessary flags
msg.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT | MapiMessageFlags.MSGFLAG_HASATTACH);

// open in outlook for editing
msg.Save(“test.msg”);

This doesn't work. The example code doesn't compile for us.

We are using ASP.Net 3.5 in VS2008, would this be the reason for that?

Hi,

Could you please check which version of Aspose.Network for .NET are you using? I checked it with v6.7 with VS 2008 and .NET 3.5. Attached is a sample application for your reference.

The issues you have found earlier (filed as 29609 ) have been fixed in [this update ](http://www.aspose.com/community/files/51/.net-components/aspose.network-for-.net/entry325827.aspx).

This message was posted using Notification2Forum from Downloads module by aspose.notifier.