Windows Mail Programming - how to assign an account to an email message

  • Thread starter Thread starter alfred
  • Start date Start date
A

alfred

Hello. I'm trying to learn the Windows Mail API and have run into a
problem I can't figure out. I've been unable to find any good
resources on the Windows Mail API and have only found 1 example which
only covered the basics. The problem is when I create an email there
is no account assigned to it. When Outlook Express tries to send this
email message I get a warning telling me that no account has been
assigned to the message and asks me if I'd like to use my default
account to send it.

Using the example I found, I was able to determine that the account
name was assigned to a property named "att:athena-account-name" when
an email message was created using OE. This property is not visible
when viewing the message source in OE. I was unable to find any
information on this or the other properties that appeared to be OE
specific.

How do I assign an account to an email programmatically using the
Windows Mail API?
Where can I find more information of these properties that OE uses to
associate emails with accounts and how to set them?

I am running Windows XP and Outlook Express 6.
Any and all help is appreciated.

Thanks in advance,

Alfred
 
Thanks Shawn.

I'm actually running Windows XP and Outlook Express 6. I wasn't sure
which group to post my question to since it actually has to deal with
the Windows Mail API and using it to program messaging applications.

The API is located here -> http://msdn2.microsoft.com/en-gb/library/ms709546.aspx

I found no groups referencing this API so I thought I'd try here.
However, in the time between my first post and now I have answered my
own question and I will explain it here for anyone else who is
interested in using the Windows Mail API to create and send emails.

The string "att:athena-account-name" is found in the file "mimeole.h"
and appears to be an attribute (as I suspected) as the title of the
section would indicate "Attributes Available through IMimePropertySet/
IMimeBody". Now I should be able to take these attributes, now that
I've found where they are defined, and use them to set the appropriate
fields in the IMimePropertSet object. Doing so should associate an
account with the email I've created. This should allow OE (and I
assume Windows Mail with slight modifications to the code) to send the
email without warning me that an account has not been associated with
the email.

Thanks again,

Alfred
 
Back
Top