Extract Recipient from Outlook

  • Thread starter Thread starter Chad Parks
  • Start date Start date
C

Chad Parks

Hello,

I was wondering if anyone knows if it is possible to
extract a RECIPIENT from an Outlook message externally.
In other words, is there a way for an ASP or Coldfusion
web app to extract a recipient from an Outlook message for
submitting to a SQL database? (This is what I'm trying to
accomplish)

Any help would be greatly appreciated,

Chad Parks
 
Sure, you can use any programming language that supports use of the Outlook
object model. Or you could use CDO 1.21 or Extended MAPI for that. Look at
www.outlookcode.com for lots of information about working with Outlook code
and the security restrictions that are on things like the Recipients
collection.
 
When I try to create the Outlook Application object, I get
this error:

Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object: 'MAPI.Session'
/mailtest.asp, line 5

Any ideas?

Chad
 
believe me....
there is no easy way out. But nobody will tell you this. They will point
you to various web sites. I had also asked the same question and got 3-4
replies but they were not what I had asked for.
Somebody would point you to website that will show how to get sender address
[thats not you have also asked for].
Somebody will tell you to use CDO and when you investigate, you would come
to know that CDO is not supported anymore.
Somebody will tell you to use Recipient object but that does not return the
SMTP address.

SO, don't ask anybody here. Try to investigate. I have seen some code in
Redemption using extended mapi. I tried it using external applications [not
VBA or VB] and it did not work too.
here is a code and website for your reference:

http://www.outlookcode.com/d/code/getsenderaddy.htm#redemption

Function R_GetSenderAddress(objMsg)
Dim strType
Dim objSenderAE ' Redemption.AddressEntry
Dim objSMail ' Redemption.SafeMailItem
Const PR_SENDER_ADDRTYPE = &HC1E001E
Const PR_EMAIL = &H39FE001E

Set objSMail = CreateObject("Redemption.SafeMailItem")
objSMail.Item = objMsg
strType = objSMail.Fields(PR_SENDER_ADDRTYPE)
Set objSenderAE = objSMail.Sender
If Not objSenderAE Is Nothing Then
If strType = "SMTP" Then
R_GetSenderAddress = objSenderAE.Address
ElseIf strType = "EX" Then
R_GetSenderAddress = objSenderAE.Fields(PR_EMAIL)
End If
End If

Set objSenderAE = Nothing
Set objSMail = Nothing
End Function
 
MAPI.Session isn't using the Outlook object model, it uses CDO 1.21, which
is an optional installation for Outlook 2000 and later. It's probably not
installed on your computer.

Despite what the other poster said, using CDO 1.21 is still supported. It
has to be, not everything is exposed to the Outlook object model. The down
side to using CDO is that it's not trusted in any Outlook code so you will
receive the security prompts when accessing the Recipients collection.
Redemption (www.dimastr.com/redemption) or Extended MAPI (C++ or Delphi code
only) won't fire the security prompts. So in that respect the poster was
correct, and I myself would use Redemption code in this case to avoid the
security prompts.
 
Back
Top