Use the Recipients
property instead of the string To
field which may contain the name of the sender, not the actual email address. Use Recipients(index)
, where index is the name or index number, to return a single Recipient
object. The name can be a string representing the display name, the alias, or the full SMTP email address of the recipient.
The Recipient.Type returns or sets a long representing the type of recipient. For the MailItem
a recipient can have one of the following OlMailRecipientType
constants: olBCC
, olCC
, olOriginator
, or olTo
. So, iteraring over all recipients and checking the Type
property value you can find the To
recipients.
For d = 1 To myItem.Recipients.count
Debug.Print myItem.Recipients.item(d).name
Debug.Print myItem.Recipients.item(d).Type
Next
Finally, you can use all properties of the Recipient
object to get the email address such as Address or just set up the new email with the same object by using the Recipients.Add method which creates a new recipient in the Recipients
collection. It accepts a string which represents the name of the recipient representing the display name, the alias, or the full SMTP email address of the recipient.
Note, you can get the Sender related properties from the original item without creating a reply-all draft item.