get messageid from mail

K

Kovary Adam

Hi.

I am using Outlook 2000 from delphi6 with COM objects.
I have a NameSpace, MapiFolder, and a MailItem, etc.
Everything is fine, except that I can
not figure out how to access some internal mail message
information like message-id, etc. So, my question is
how can I access the 'header' of a message with MailItem?

Thanks in advance,
Koadam
 
M

Mike Leftwich

I am using Outlook 2000 from delphi6 with COM objects.
I have a NameSpace, MapiFolder, and a MailItem, etc.
Everything is fine, except that I can
not figure out how to access some internal mail message
information like message-id, etc. So, my question is
how can I access the 'header' of a message with MailItem?

Look at MailItem.EntryID.

Mike
 
K

Kovary Adam

Hi.

Well, MailItem.EntryId differs from what i am expecting.
I expect a standard (rfc822?) message-id, what can be found
in the mail header, and looks like
'<[email protected]>'.
Messages what I will handle always come from the internet
(not a internal exhcange message), so they will have to
have this message-id.
So, I need to access somehow the message headers.
Can you show me a point how can I do this?
Thanks,
koadam
 
S

Sue Mosher [MVP-Outlook]

If you want the SMTP header ID, you'll need to use CDO or, to avoid security
prompts, REdemption. See http://www.outlookcode.com/d/forms/headers.htm for
a form with sample code.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

Kovary Adam

Well, I am using CDO now. I have an IMessage.
I parse the Fields property, but it contains only
strings beginning with "urn:".... So these are not
the internet headers.
When I try to access the IMessage.EnvelopeFIelds
i got an error saying "requesetd property or feature
while supported is not availabla at this time or in this
context"

I am very depressed. I can't access the internet headers
of a mail message.
What should I do with IMessage to have the headers?

urn:schemas:httpmail:content-media-type" value="text/plain"
urn:schemas:httpmail:hasattachment" value="False"
urn:schemas:httpmail:htmldescription" value=""

thanks,
Koadam
 
S

Sue Mosher [MVP-Outlook]

Sounds like you're using CDO for Windows, not CDO 1.21, which is what you
use in an Outlook client application, such as the sample form I suggested.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

Kovary Adam

I am confused.
I have tried importing two files form my system32 directory.
cdosys.dll (1.0), cdonts.dll (1.2).

The generated typelib files (i use delphi6) have the same
size.
Should I download and install a newer version?

K.
 
S

Sue Mosher [MVP-Outlook]

No, you need a *different* version.

Cdosys.dll = CDO for Windows
Cdonts.dll = CDONTS

CDO 1.21, what you need, is Cdo.dll, an optional component of the Outlook
installation. You may need to rerun Office/Outlook setup to add it. See
http://www.outlookcode.com/d/cdo.htm for more information.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

Mike Leftwich

I have tried importing two files form my system32 directory.
cdosys.dll (1.0), cdonts.dll (1.2).

The type library you're looking for is labeled "Microsoft CDO 1.21 Library
(Version x.xx)" in the Import Type Library dialog box inside Delphi. If you
do not see this type library listed, then you probably don't have CDO
installed and registered. Follow the instructions Sue directed you to to
install CDO from your Office CD, then patch it up by visiting
http://office.microsoft.com/en-us/officeupdate/default.aspx. Once you do
that, the library should show up in the list of available type libraries in
Delphi.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top