B
Bingo
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
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