Search The ForumSearch   RegisterRegister  LoginLogin

MailBee IMAP4

 AfterLogic Forum : MailBee IMAP4
Subject Topic: Forwarding a message as an attachment Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
David Poirier
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 27 June 2005 at 9:16pm | IP Logged Quote David Poirier

I am using the IMAP4 and SMTP components. I want to loop through all of the messages in my IMAP4 Inbox, creating a new message each time and attaching the existing message to the new message before sending it.

In order words, I want to forward each message in my Inbox as an attachment on a new message. I want to be able to open the attached message in Outlook, so it would need to be in the binary ".msg" format that Outlook seems to use.

How can I do this?
Back to Top View David Poirier's Profile Search for other posts by David Poirier
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 28 June 2005 at 8:32am | IP Logged Quote Alex

You can forward message as attachment by saving original message into a file and then appending this file to the forwarded message:

Code:

' Assume Msg1 is a source message (which came from IMAP)
' Assume SMTP.Message is a forwarded message

Msg1.SaveMessage "C:\Temp\Original message.eml"
SMTP.Message.AddAttachment "C:\Temp\Original message.eml", "message/rfc822"

' Msg was forwarded with SMTP.Message. Is't now save to delete or overwrite "C:\Temp\Original message.eml" file


If you wish to make original message have different filename in the forwarded message,
you can also specify FilenameInMessage parameter of AddAttachment method:

Code:

SMTP.Message.AddAttachment "C:\Temp\tempfile.tmp", "message/rfc822", "Meeting request.eml"


You can also force original message have no filename at all (Yahoo mail uses this format when forwarding) by specifying FilenameInMessage="<none>":

Code:

SMTP.Message.AddAttachment "C:\Temp\tempfile.tmp", "message/rfc822", "<none>"


Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
David Poirier
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 29 June 2005 at 10:44pm | IP Logged Quote David Poirier

This works Alex, I was leaving off the MIME type "message/rfc822".

Here's a suggestion: add "Reply", "ReplyAll", and "Forward" methods to the "Message" object, and have each of them return a new message ready to go. The "Forward" method should have an option to include the original message quoted/unquoted inline or as an attachment.

Thank you.
Back to Top View David Poirier's Profile Search for other posts by David Poirier
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 30 June 2005 at 8:54am | IP Logged Quote Alex

Thank you for the suggestion. We'll consider this for future versions.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide