Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get RECIPIENTS SMTP Address when OFFLINE from Exchange Server

22 views
Skip to first unread message

Sanjay Singh

unread,
Oct 28, 2003, 6:06:43 AM10/28/03
to
This is different from my previous post. This time I need the recipients
SMTP address.

I have included some code at the end of this message that I use to get an
Email Recipient's Email address. I convert Exchange addresses to SMTP
addresses
and it works perfectly EXCEPT if the user is using Outlook offline form the
Exchange Server.

My question: What do I need to do to get the correct SMTP address for
Exchange users even when I am offline?

Thanks in advance
Sanjay


Public Function RecipientEmail(oItem As MailItem, Optional boolMsg = True)
As String

Dim strType As String
Dim oSafeRec As Redemption.AddressEntry
Dim oSafeMail As Redemption.SafeMailItem

On Error GoTo HandleErr
'On Error Resume Next
RedemptionCleanup

Set oSafeMail = CreateObject("qfRedemption.qfSafeMailItem")
oSafeMail.Item = oItem
Set oSafeRec = oSafeMail.Recipients(1).AddressEntry
strType = oSafeRec.Type
If strType = "EX" Then
RecipientEmail = oSafeRec.Fields(&H39FE001E)
ElseIf strType = "SMTP" Then
RecipientEmail = oSafeRec.Address
End If

Set oSafeMail = Nothing
Set oSafeRec = Nothing

RedemptionCleanup
ExitHere:
Exit Function

' Error handling block added by Error Handler Add-In. DO NOT EDIT this block
of code.
' Automatic error handler last updated at 10-17-2002 11:16:21
'ErrorHandler:$$D=10-17-2002 'ErrorHandler:$$T=11:16:21
HandleErr:
Select Case Err.Number
Case Else
'MsgBox "Error " & Err.Number & ": " & Err.Description,
vbCritical, "basGlobals.RecipientEmail"
'ErrorHandler:$$N=basGlobals.RecipientEmail
If boolMsg Then
MsgBox "E-mail address cannot be resolved. Please check
e-mail address.", vbExclamation, "Invalid E-mail Address"
End If
End Select
RedemptionCleanup
' End Error handling block.
End Function


Dmitry Streblechenko

unread,
Oct 28, 2003, 2:46:50 PM10/28/03
to
0x39FE001E is not available offline. Read PR_EMS_AB_PROXY_ADDRESSES
(0x800F101E) instead from AddressEntry. This property is a multivalued
string property (PT_MV_STRING8), Redemption will return a variant array of
strings. Look for an entry with the "SMTP:" prefix (note the caps), it will
be the default SMTP address.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Sanjay Singh" <san...@standss.com.fj> wrote in message
news:OwINUOUn...@TK2MSFTNGP09.phx.gbl...

Sanjay Singh

unread,
Oct 28, 2003, 3:28:12 PM10/28/03
to
Would you have some sample code to do this.
Thanks
Sanjay

"Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message
news:OnGp4wYn...@TK2MSFTNGP11.phx.gbl...

Dmitry Streblechenko

unread,
Oct 28, 2003, 7:44:18 PM10/28/03
to
Set oSafeMail = CreateObject("qfRedemption.qfSafeMailItem")
oSafeMail.Item = oItem
Set oSafeRec = oSafeMail.Recipients(1).AddressEntry
strType = oSafeRec.Type
If strType = "EX" Then
Addresses = oSafeRec.Fields(&H800F101E)
for i = LBound(Addresses) to UBound(Addresses)
if Left(Addresses(i), 5) = "SMTP:" Then
RecipientEmail = Right(Addresses(i), Len(Addresses(i))-5)
End If
next

ElseIf strType = "SMTP" Then
RecipientEmail = oSafeRec.Address
End If

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Sanjay Singh" <san...@standss.com.fj> wrote in message

news:uj9QEIZn...@TK2MSFTNGP12.phx.gbl...

0 new messages