![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to read the header of e-mail message in Exchange 2003 by usingVBS? Hello, Does anybody know how to read the details of one single message by using VBS script? I am trying to write a script which will be reading single e-mail. I really need basic information about library which should be used in Exchange 2003. Regards, esska |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to read the header of e-mail message in Exchange 2003 by using VBS? esska wrote: Quote: > Hello, > Does anybody know how to read the details of one single message by > using VBS script? > I am trying to write a script which will be reading single e-mail. I > really need basic information about library which should be used in > Exchange 2003. the inbox? I use code similar to below to read all messages in an Outlook inbox: ========== ' Retrieve Outlook Inbox folder. Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") Set objFolder = objNameSpace.GetDefaultFolder(6) ' Enumerate messages in Inbox. lngCount = objFolder.Items.Count For k = 1 To lngCount Set objItem = objFolder.Items(k) ' Number of attachements. intAttach = objItem.Attachments.Count For j = 1 to intAttach ' Name of attachment. strFile = objItem.Attachments.Item(j).FileName Next ' Body of message. strBody = LCase(objItem.Body) ' HTML message. On Error Resume Next strHTMLBody = LCase(objItem.HTMLBody) If (Err.Number <> 0) Then strHTMLBody = "" End If On Error GoTo 0 ' Size of message lngSize = objItem.Size ' Received time of message. strReceived = objItem.ReceivedTime ' Message subject. strSubject = objItem.Subject Next ======= This example displays nothing, it just demonstrates how to retrieve some information. It also only retrieves the messages in the user's own inbox, assuming Outlook is installed and configured on the computer. You can search the web for more information on Outlook.Application, or inquire in an Outlook or Exchange newsgroup. I have seen code that enumerates all mailboxes in Exchange and documents mailbox size and number of messsages. That looks similar to: ======= strComputer = "MyServer" Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftExchangeV2") Set objMbxs = objWMI.ExecQuery("SELECT * FROM Exchange_Mailbox",,48) For Each objMbx In objMbxs Wscript.Echo objMbx.MailBoxDisplayName _ & ", " & objMbx.Size & "KB, " & objMbx.TotalItems & " items" Next -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How to read the header of e-mail message in Exchange 2003 byusing VBS? On 25 Wrz, 17:28, "Richard Mueller [MVP]" <rlmueller- nos...@xxxxxx> wrote: Quote: > esska wrote: Quote: > > Hello, > > Does anybody know how to read the details of one single message by > > using VBS script? > > I am trying to write a script which will be reading single e-mail. I > > really need basic information about library which should be used in > >Exchange2003. > How do you identify which message to deal with, or will there be only onein > the inbox? I use code similar to below to read all messages in an Outlook > inbox: > ========== > ' Retrieve Outlook Inbox folder. > Set objOutlook = CreateObject("Outlook.Application") > Set objNamespace = objOutlook.GetNamespace("MAPI") > Set objFolder = objNameSpace.GetDefaultFolder(6) > > ' Enumerate messages in Inbox. > lngCount = objFolder.Items.Count > > For k = 1 To lngCount > * * Set objItem = objFolder.Items(k) > * * ' Number of attachements. > * * intAttach = objItem.Attachments.Count > * * For j = 1 to intAttach > * * * * ' Name of attachment. > * * * * strFile = objItem.Attachments.Item(j).FileName > * * Next > * * ' Body of message. > * * strBody = LCase(objItem.Body) > * * ' HTML message. > * * On Error Resume Next > * * strHTMLBody = LCase(objItem.HTMLBody) > * * If (Err.Number <> 0) Then > * * * * strHTMLBody = "" > * * End If > * * On Error GoTo 0 > * * ' Size of message > * * lngSize = objItem.Size > * * ' Received time of message. > * * strReceived = objItem.ReceivedTime > * * ' Message subject. > * * strSubject = objItem.Subject > Next > ======= > This example displays nothing, it just demonstrates how to retrieve some > information. It also only retrieves the messages in the user's own inbox, > assuming Outlook is installed and configured on the computer. You can search > the web for more information on Outlook.Application, or inquire in an > Outlook orExchangenewsgroup. > > I have seen code that enumerates all mailboxes inExchangeand documents > mailbox size and number of messsages. That looks similar to: > ======= > strComputer = "MyServer" > Set objWMI = GetObject("winmgmts:\\" & strComputer & > "\root\MicrosoftExchangeV2") > Set objMbxs = objWMI.ExecQuery("SELECT * FROM Exchange_Mailbox",,48) > For Each objMbx In objMbxs > * * Wscript.Echo objMbx.MailBoxDisplayName _ > * * * * & ", " & objMbx.Size & "KB, " & objMbx.TotalItems & " items" > Next > -- > Richard Mueller > MVP Directory Services > Hilltop Lab -http://www.rlmueller.net > -- I try to get header from Exchange Outlook Web Access (OWA). I cannot see any header just, the information when the e-mail was sent. This information is in BODY. I was wondering if is some class in vbscript which may contain the delivery time. Regards, esska |
My System Specs![]() |
| | #4 (permalink) |
| | Re: How to read the header of e-mail message in Exchange 2003 byusing VBS? The problem is with showing some parameters in e-mails. There is no information about delivery, sent and receiving time. Does anybody know how to see it? I was trying to do this by using OWA but if abybody knows how to do this by Outlook or other sourse I would be grateful for ANY help! Regards, esska |
My System Specs![]() |
| | #5 (permalink) |
| | Re: How to read the header of e-mail message in Exchange 2003 by using VBS? When viewing the message in Outlook, select the View menu then Options. You'll see the message headers there, which contain the goodies you're looking for. "esska" <esska@xxxxxx> wrote in message news:559cb77a-cde4-4739-8ab9-a5d4fa2955b7@xxxxxx Quote: > The problem is with showing some parameters in e-mails. There is no > information about delivery, sent and receiving time. Does anybody know > how to see it? I was trying to do this by using OWA but if abybody > knows how to do this by Outlook or other sourse I would be grateful > for ANY help! > > Regards, > esska > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: How to read the header of e-mail message in Exchange 2003 byusing VBS? Thanks for advice. I had to read the header direct from Exchange server. I had to use OWA (there is no option to see internet headers). The problem was resolved by using: Const CdoPR_TRANSPORT_MESSAGE_HEADERS = &H7D001E Like in simple Outlook. Thanks for help ![]() Regards, esska |
My System Specs![]() |
| | #7 (permalink) |
| | Re: How to read the header of e-mail message in Exchange 2003 byusing VBS? The problem was solved |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can I use Windows Mail to access my mail from MS Exchange 2003? | Vista mail | |||
| Windows Live Mail: Header and message don't match | Windows Live | |||
| Mail downloads header but not Body of message | Vista mail | |||
| Header message changed in Windows mail | Vista mail | |||
| Exchange 2003: Finding NDR e-mail addresses ? | PowerShell | |||