Hi,
Please can you help me to retain a .MSG internet headers after modifying and saving the message?
Thanksv
Hi,
Please can you help me to retain a .MSG internet headers after modifying and saving the message?
Thanksv
Hi,
Hi,
Thanks for you reply. I have managed to get that working but I do have another problem.
I'm busy creating an Email Branding application for my company. We currently just using the trial version of the .NET Component. We have managed to insert an embedded MHT and JPEG file. My requirement is to remove my embedded MHT and JPEG files from an email coversation when replying. In this way only the latest reply gets branded with my companies details, all my other previous branding will be stripped.
Please can you assist?
Thanks
Hi,
You can identify the embedded attachments with below source code,
foreach (MapiAttachment att in message.Attachments)
{
if (att.Properties.Contains(MapiPropertyTag.PR_ATTACH_CONTENT_ID_A) || att.Properties.Contains(MapiPropertyTag.PR_ATTACH_CONTENT_ID_W))
{
Console.WriteLine("Embedded, inline or linked Attachment File Name: " + att.LongFileName);
}
else
{
Console.WriteLine("Regular Attachment File Name: " + att.LongFileName);
}
[//att.Save](https://att.save/)(att.FileName);
}
Once identified, you can remove any embedded message with MapiAttachmentCollection .Remove() method.
For adding any image as an embedded resource in your email message, please check out the video tutorial for your reference.
HiThanks for this, but I still have an issue. I'm not using the MAPI reference, I'm using the Aspose.Email.Mail; reference. When I perform the below code I get an error "Collection was modified; enumeration operation may not execute.Collection was modified; enumeration operation may not execute."
foreach (Attachment att in msg.Attachments)
{
Console.WriteLine(att.ContentId);
if (att.ContentId.Substring(att.ContentId.Length - 2, 2) == "XT")
{
att.Save(@"c:\test\" + att.Name);
msg.Attachments.Remove(att);
};
} foreach (Attachment att in msg.Attachments)
{
Console.WriteLine(att.ContentId);
if (att.ContentId.Substring(att.ContentId.Length - 2, 2) == "XT")
{
att.Save(@"c:\test\" + att.Name);
msg.Attachments.Remove(att);
};
}
Can you tell me if there is a way for us to add some kind of tag to the embedded image/file when I am adding it to the new email and then when there is a reply being sent off can I remove that previous embedded image?
Hi,
Hi,
Thanks for the reply. I have managed to fix the error. It was an error in the coding sample in my previous reply.
My current approach is
1. fetch message from server
2. load a MHT file into a seperate variable (msg2) - this is the header for my message
3. i then have a string variable (body) which will get the htmlBody from msg2
4. append the fetched message body to the "body" variable which will provide the both messages joined and I will have a header.
Is there any other way to include a header/footer to the email?
Thanks
Hi.
Hi,
See attached an example of what I am trying to achieve.
Thanks
Hi,