Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim Email As Outlook.MailItem
- Dim domaintype As String ' domaintype is given
- ' domaintype = "@aaa.com"
- ' domaintype = "@bbb.com"
- Dim recipientname As String ' recipient name is partially known
- ' recipientname = "John Doe"
- if domaintype = "@aaa.com" then
- With Email
- ' How do I add the correct recipient?
- .Recipient.Add recipientname ' SMTP address = john@aaa.com for "John Doe"
- End With
- elseif domaintype = "@bbb.com" then
- With Email
- ' How do I add the correct recipient?
- .Recipient.Add recipientname ' SMTP address = doe@bbb.com for "John Doe2"
- End With
- else
- ' do something else
- end if
- Email.Recipients.ResolveAll ' "John Doe" is not resolved because it is ambiguous!
Add Comment
Please, Sign In to add comment