S
Sanjay Singh
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
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