How to get mail header

Status
Not open for further replies.
A

Ashish

PR_TRANSPORT_MESSAGE_HEADERS contains mail header. For those mails which

dont have PR_TRANSPORT_MESSAGE_HEADERS property how to get their headers?
 
They won't have headers if they don't have PR_TRANSPORT_MESSAGE_HEADERS.

Only emails sent over the Internet have that property. If the email was sent

internally using Exchange the property and mail headers won't exist on that

item.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:OATAgdqCKHA.1252@TK2MSFTNGP04.phx.gbl...
> PR_TRANSPORT_MESSAGE_HEADERS contains mail header. For those mails which
> dont have PR_TRANSPORT_MESSAGE_HEADERS property how to get their headers?
>
 
If i login to any exchange user account, and send a web page to exchange

user ( open internetexplorer for google.com web page and select

File->Send->Page By Email...).

This mail will not contain PR_TRANSPORT_MESSAGE_HEADERS.

Is there any other property for this mail which allow me to read mail

contents.
<kenslovak@mvps.org> wrote in message

news:uCZJaXtCKHA.3708@TK2MSFTNGP02.phx.gbl...
> They won't have headers if they don't have PR_TRANSPORT_MESSAGE_HEADERS.

> Only emails sent over the Internet have that property. If the email was
> sent internally using Exchange the property and mail headers won't exist
> on that item.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:OATAgdqCKHA.1252@TK2MSFTNGP04.phx.gbl...
> > PR_TRANSPORT_MESSAGE_HEADERS contains mail header. For those mails which
> > dont have PR_TRANSPORT_MESSAGE_HEADERS property how to get their headers?
> >

>
 
What do you mean read mail contents?

If you get the item as a MailItem you can read every property it has. What

properties do you want to get? If the item was sent by you it should be in

Sent Items. You obviously can't read the message that was received by the

recipient, it's in his mailbox (unless you have permissions to access his

mailbox).

It still won't have Internet headers since it never was sent over the

Internet if it was strictly an internal email.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:%23Wsxk$tCKHA.1492@TK2MSFTNGP03.phx.gbl...
> If i login to any exchange user account, and send a web page to exchange
> user ( open internetexplorer for google.com web page and select
> File->Send->Page By Email...).
> This mail will not contain PR_TRANSPORT_MESSAGE_HEADERS.
> Is there any other property for this mail which allow me to read mail
> contents.
 
If i login to exchange user, create a new mail and send to same user then

mail comes in its Inbox and SentItems folder. And both mails have

PR_TRANSPORT_MESSAGE_HEADERS property. I need mail header b'se i write my

own data in mail header(urn:schemas:mailheader:mytag)

In outlook addin i need to get mail header b'se i want to get mytag which i

wrote in mail.

For below specific case when send a mail using web page, mail dont contain

PR_TRANSPORT_MESSAGE_HEADERS. So my question is

"Is there any possiblity to get mail header in outlook addin if above

property is not present"
<kenslovak@mvps.org> wrote in message

news:%23vSZ7BvCKHA.4432@TK2MSFTNGP05.phx.gbl...
> What do you mean read mail contents?

> If you get the item as a MailItem you can read every property it has. What
> properties do you want to get? If the item was sent by you it should be in
> Sent Items. You obviously can't read the message that was received by the
> recipient, it's in his mailbox (unless you have permissions to access his
> mailbox).

> It still won't have Internet headers since it never was sent over the
> Internet if it was strictly an internal email.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:%23Wsxk$tCKHA.1492@TK2MSFTNGP03.phx.gbl...
> > If i login to any exchange user account, and send a web page to exchange
> > user ( open internetexplorer for google.com web page and select
> > File->Send->Page By Email...).
> > This mail will not contain PR_TRANSPORT_MESSAGE_HEADERS.
> > Is there any other property for this mail which allow me to read mail
> > contents.

>
 
If you send an email entirely within Exchange and it never leaves the server

there will not be any PR_TRANSPORT_MESSAGE_HEADER in the email Exchange does

not add those headers for internal emails.

If you send an email over the Internet the received email will have the

PR_TRANSPORT_MESSAGE_HEADER property. The sent item in the Sent Items folder

will never have that property, so I have no idea what you're talking about.

Check it yourself with a MAPI viewer such as OutlookSpy. There are no

headers in the sent item, period.

In a case where there is no property like that obviously there are no

headers, so how can you read the headers? It's impossible.

If you are adding headers to outgoing items using the special named MAPI

property trick then in internal only emails that stay within Exchange there

still won't be any PR_TRANSPORT_MESSAGE_HEADER property on the item but the

MAPI property you added will be there and can be read as a MAPI property.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:%23dQwmH4CKHA.4168@TK2MSFTNGP05.phx.gbl...
> If i login to exchange user, create a new mail and send to same user then
> mail comes in its Inbox and SentItems folder. And both mails have
> PR_TRANSPORT_MESSAGE_HEADERS property. I need mail header b'se i write my
> own data in mail header(urn:schemas:mailheader:mytag)
> In outlook addin i need to get mail header b'se i want to get mytag which
> i wrote in mail.

> For below specific case when send a mail using web page, mail dont contain
> PR_TRANSPORT_MESSAGE_HEADERS. So my question is
> "Is there any possiblity to get mail header in outlook addin if above
> property is not present"
 
Yes you are right if we add headedr then we can read as MAPI property on

exchange server.

Thanks for clear understanding.

In outlook addin we can read mail header using PR_TRANSPORT_MESSAGE_HEADER

For all mails we can read header using PR_TRANSPORT_MESSAGE_HEADER in

outlook addin. and using MAPI property on exchange server.

But below case(send mail using webpage) MAPI property on exchange server

can read header, but outlook addin fail to read header. It shows empty

header.

Is there any reason why it's happening
<kenslovak@mvps.org> wrote in message

news:OXLLcr5CKHA.3800@TK2MSFTNGP04.phx.gbl...
> If you send an email entirely within Exchange and it never leaves the
> server there will not be any PR_TRANSPORT_MESSAGE_HEADER in the email
> Exchange does not add those headers for internal emails.

> If you send an email over the Internet the received email will have the
> PR_TRANSPORT_MESSAGE_HEADER property. The sent item in the Sent Items
> folder will never have that property, so I have no idea what you're
> talking about. Check it yourself with a MAPI viewer such as OutlookSpy.
> There are no headers in the sent item, period.

> In a case where there is no property like that obviously there are no
> headers, so how can you read the headers? It's impossible.

> If you are adding headers to outgoing items using the special named MAPI
> property trick then in internal only emails that stay within Exchange
> there still won't be any PR_TRANSPORT_MESSAGE_HEADER property on the item
> but the MAPI property you added will be there and can be read as a MAPI
> property.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:%23dQwmH4CKHA.4168@TK2MSFTNGP05.phx.gbl...
> > If i login to exchange user, create a new mail and send to same user then
> > mail comes in its Inbox and SentItems folder. And both mails have
> > PR_TRANSPORT_MESSAGE_HEADERS property. I need mail header b'se i write my
> > own data in mail header(urn:schemas:mailheader:mytag)
> > In outlook addin i need to get mail header b'se i want to get mytag which
> > i wrote in mail.
>

>> For below specific case when send a mail using web page, mail dont
> > contain PR_TRANSPORT_MESSAGE_HEADERS. So my question is
> > "Is there any possiblity to get mail header in outlook addin if above
> > property is not present"

>
 
I have no idea what that Web page is sending out. If it meets the normal

RFC's for Internet email then it should be providing message headers and

those should be in the PR_TRANSPORT_MESSAGE_HEADERS property.

If the MAPI property is there (x-header MAPI property) instead of the

correct PR_TRANSPORT_MESSAGE_HEADERS property then I can only assume the Web

page is using Exchange and not sending over the Internet.

If it was truly Internet email sent out by the Web page then the MAPI

property would mean nothing to it. That sort of MAPI property is translated

into an x-header by MAPI when the email goes out through the message

transport. And the MAPI property can only be added using MAPI or an

equivalent API. The property means nothing to something like SMTP mail, or

SQL Server mail or whatever. Certainly a MAPI extended property wouldn't be

preserved except by MAPI.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:%23w$lVB6CKHA.2832@TK2MSFTNGP03.phx.gbl...
> Yes you are right if we add headedr then we can read as MAPI property on
> exchange server.
> Thanks for clear understanding.
> In outlook addin we can read mail header using PR_TRANSPORT_MESSAGE_HEADER

> For all mails we can read header using PR_TRANSPORT_MESSAGE_HEADER in
> outlook addin. and using MAPI property on exchange server.
> But below case(send mail using webpage) MAPI property on exchange server
> can read header, but outlook addin fail to read header. It shows empty
> header.

> Is there any reason why it's happening
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
K How to find specific header and copy the mail body Using Outlook 0
D Outlook 2007 e-mail header- How to set font & font size in received message headers ? Using Outlook 2
P How do i add the date to subject header of incoming mail? Outlook VBA and Custom Forms 13
P Limited Support for 3rd Party Mail in new Outlook? Using Outlook 1
T Exchange Server - Mail Delay Stamping Exchange Server Administration 0
L Error when exporting Sent Mail to Excel Outlook VBA and Custom Forms 6
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
K How can I delete an e-mail from Outlook Using Outlook 1
L Help: set flag for sent mail to check if received an answer Outlook VBA and Custom Forms 2
A Macro Mail Alert Using Outlook 4
e_a_g_l_e_p_i MY Outlook 2021 changed the format of the shortcuts for mail, calendar etc. Using Outlook 10
Z Outlook 365 Automatically assign categories to incoming mail in a shared folder Round Robin Outlook VBA and Custom Forms 1
W Outlook 365 I am getting the "Either there is no default mail client" error when I try to send an email on excel Office 365 Using Outlook 1
D Gmail mail is being delivered to a different email inbox in Outlook App 2021 Using Outlook 2
P What is your strategy for dealing with SPAM and Junk Mail? Using Outlook 1
C Code to move mail with certain attachment name? Does Not work Outlook VBA and Custom Forms 3
T 1:1 Datatransfer from incoming mail body to customs form body Outlook VBA and Custom Forms 0
O Mail rule issue Using Outlook 3
A manual rule sends mail to wrong folder Using Outlook 5
Aussie Outlook 365 Rule runs manually but returns the error code "an unexpected error has occurred" when incoming mail arrives Using Outlook 1
D ISOmacro to extract active mail senders name and email, CC, Subject line, and filename of attachments and import them into premade excel spread sheet Outlook VBA and Custom Forms 2
Witzker Outlook 2019 Macro to answer a mail with attachments Outlook VBA and Custom Forms 2
D Outlook 2003 Mail Fails Using Outlook 1
Cathy Rhone Mail merge error message Using Outlook 1
R Sent emails show iCloud mail account not the alias Using Outlook 2
D Advanced e-Mail search on from/to contact group only searches for first 20 contacts in group Using Outlook 0
P Print attachments automatically and move the mail to an existing folder called "Ted" Outlook VBA and Custom Forms 4
P Importing other e-mail accounts into Outlook Using Outlook 1
lcarpay Stay in the mail folder pane after ctrl-1 Using Outlook 1
O Exchange Sync period only (e.g. last years mail) Using Outlook 0
F Excel VBA to move mails for outlook 365 on secondary mail account Outlook VBA and Custom Forms 1
M Convertor for Outlook Express Mail Store (.dbx) to Outlook Mail Store (.pst) Using Outlook 0
T vba extract data from msg file as attachment file of mail message Outlook VBA and Custom Forms 1
J E-mail held in Outbox while Minimized Using Outlook 3
G Forward email body to other mail list directly from Exchange server Exchange Server Administration 1
T Outlook creates a copie of every mail I send Using Outlook.com accounts in Outlook 4
N Please advise code received new mail Using Outlook 0
M Outlook 2010 How could I globally redesign an outlook template form/region/inspector template used to display mail lists or an individual mails? Outlook VBA and Custom Forms 0
A How to stop user form from disapearing once mail window is closed? Outlook VBA and Custom Forms 0
M Outlook, send to > mail recipient - results in plain text email Using Outlook 1
R How to Sync *all* Google Workspace Mail Folders with Outlook 2019 (MS365) Using Outlook 3
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
E Having some trouble with a run-a-script rule (moving mail based on file type) Outlook VBA and Custom Forms 5
S Outlook email to configure setup for each mail Outlook VBA and Custom Forms 1
L Correct E-Mail Pulling Wrong Mail Using Outlook 5
S Outlook mail adressing stops after first match in GAL Using Outlook 0
P Outlook 2013 All imported Mail Rules in error when imported into new profile Using Outlook 5
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
MrMayor SENT mail not reloading to top?? Using Outlook 4

Similar threads

Back
Top