Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / November 2004

Tip: Looking for answers? Try searching our database.

Failed to resolve recipient in Redemption?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bingo - 26 Nov 2004 21:30 GMT
On my custom form, I create a new mail item and send it
to myself during the Item_Send event.  I got the
following error and the code failed when I tried to send
it out.  Since I saved the email in the draft folder,
when I opened the email, I can see that it took a few
seconds for Outlook to resolve the recipient name/my
name.  Any recommendations?  Thanks.  

Error message:
An exception of type 'Redemption.SafeMailItem: Could not
resolve the message recipients' was not handled

VBScript code:

Dim oNsp        ' Outlook Namespace
Dim oMail        ' Outlook Mail Item
Dim oRdpMailItem    ' Redemption Safe Mail Item
Dim oRdpRecipients    ' Redemption Safe Mail Recipients
Dim oRdpRecipient    ' Redemption Safe Mail recipient
Dim sMailID        ' Outlook Mail Item Entry ID
Dim lTotal        ' Total Number of Recipients
Dim lCnt        ' Recipient Counter

Function Item_Send()

' Only process outgoing emails using the custom form

    ' Outlook Namespace
    Set oNsp = Item.Session

    ' Clone a mail off Item
    Set oMail = Item.Copy
    ' To save the new mail to avoid overwriting
    oMail.Save
    sMailID = oMail.EntryID

    ' Recycle object
    Set oMail = Nothing
    Set oMail = oNsp.GetItemFromID(sMailID)

    ' Redemption Safe Mail Item
    Set oRdpMailItem = CreateObject
("Redemption.SafeMailItem")
    oRdpMailItem.Item = oMail

    Set oRdpRecipients = oRdpMailItem.Recipients

    ' Remove all recipients
    lTotal = oRdpMailItem.Recipients.Count
    For lCnt = lTotal To 1 Step -1
        oRdpMailItem.Recipients.Remove lCnt
    Next

    ' Add my Mailbox as the only recipient
    oRdpMailItem.Recipients.Add "Bingo"
'    oRdpMailItem.Recipients.ResolveAll

    ' Send out the new mail
    oRdpMailItem.Send

    ' Cleanup
    Set oRdpMailItem = Nothing
    Set oRdpRecipients = Nothing
    Set oRdpRecipient = Nothing
    Set oNsp = Nothing
    Set oMail = Nothing
End Function
Ken Slovak - [MVP - Outlook] - 29 Nov 2004 14:17 GMT
Always check for .Resolved = True for any recipients you add. Also, "Bingo"
might not be resolvable. Is that your EX alias? Try using the full mailbox
name or Exchange alias. If all else fails for a test try using your explicit
SMTP address.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> On my custom form, I create a new mail item and send it
> to myself during the Item_Send event.  I got the
[quoted text clipped - 63 lines]
> Set oMail = Nothing
> End Function
Bingo - 29 Nov 2004 14:31 GMT
Ken,

Bingo is a real alias.  I also tried the full mailbox
instead.  Both failed.  I'm going to try .Resolved = True
and let you know if that is the solution.  Thanks!  

>-----Original Message-----
>Always check for .Resolved = True for any recipients you add. Also, "Bingo"
[quoted text clipped - 71 lines]
>
>.
Bingo - 29 Nov 2004 15:32 GMT
I checked the return for .Resolved method.  It failed 9
out of 10 times but it did succeed once for a while with
no code changes.  It's really odd.  

>-----Original Message-----
>Always check for .Resolved = True for any recipients you add. Also, "Bingo"
[quoted text clipped - 71 lines]
>
>.
Bingo - 29 Nov 2004 16:39 GMT
I even tried to keep resolving the name for 30 seconds
but it still failed.  What can I do?  

>-----Original Message-----
>Always check for .Resolved = True for any recipients you add. Also, "Bingo"
[quoted text clipped - 71 lines]
>
>.
Ken Slovak - [MVP - Outlook] - 29 Nov 2004 19:29 GMT
Try manually putting in the SMTP address for your alias and see if that
works. Also try the SafeRecipients.AddEx method and see if that works any
better. And make sure you're using the latest version of Redemption.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> I even tried to keep resolving the name for 30 seconds
> but it still failed.  What can I do?
Bingo - 29 Nov 2004 20:38 GMT
The alias works fine when I manually put entered it.  

I changed the sequence now to remove and add recipients
directly on the Outlook MailItem and then pass it to
Redemption SafeMailItem.  It's working with this switch.  
Now sure why I cannot do this directly on the redemption
SafeMailItem.  

I'm going to try the AddEx method though.  Thanks.  

>-----Original Message-----
>Try manually putting in the SMTP address for your alias and see if that
[quoted text clipped - 5 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.