Guest User

Untitled

a guest
Dec 13th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Dim Email As Outlook.MailItem
  2. Dim domaintype As String ' domaintype is given
  3. ' domaintype = "@aaa.com"
  4. ' domaintype = "@bbb.com"
  5. Dim recipientname As String ' recipient name is partially known
  6. ' recipientname = "John Doe"
  7.  
  8. if domaintype = "@aaa.com" then
  9. With Email
  10. ' How do I add the correct recipient?
  11. .Recipient.Add recipientname ' SMTP address = john@aaa.com for "John Doe"
  12. End With
  13. elseif domaintype = "@bbb.com" then
  14. With Email
  15. ' How do I add the correct recipient?
  16. .Recipient.Add recipientname ' SMTP address = doe@bbb.com for "John Doe2"
  17. End With
  18. else
  19. ' do something else
  20. end if
  21.  
  22. Email.Recipients.ResolveAll ' "John Doe" is not resolved because it is ambiguous!
Add Comment
Please, Sign In to add comment