jrolz.blogg.se

Get cc from eagetmail vb.net
Get cc from eagetmail vb.net




If address.GetMailboxes().ConvertAll(Function(x) x.Address).Contains(email) Then Private Shared Function ContainsEmail(list As IEnumerable(Of MailAddress), email As String) As Boolean Return list.Any(address => address.GetMailboxes().ConvertAll( If (address.GetMailboxes().ConvertAll(x => x.Address).Contains(email)) Private static bool ContainsEmail(IEnumerable list, string email) Return String.Join(", ", parts.ToArray())įinally here’s a helper function, you can use when, you want to know, if specified email address is in the recipients list: This method returns all mailboxes represented by an email address: in case of MailGroup it returns all mailboxes represented by the group and all child groups, in case of MailBox returns a list containing a single mailbox:įoreach (MailBox mailbox in address.GetMailboxes())Ĭonsole.WriteLine(")", _ĭim mailbox As MailBox = DirectCast(address, MailBox) The simplest way to access actual email addresses is to use overloaded GetMailboxes method. Accounting:, “John” ).įirst remember that you need to import namespace: MailGroup – which represents group of email addresses (e.g.

get cc from eagetmail vb.net

MailBox – which represents single mailbox (e.g.In those collections you can find two kinds of objects: The reason for this, is to handle not only regular mailboxes but also email groups. IMail To, Cc, Bcc and ReplyTo properties are of IList type (that is IList Of MailAddress in VB.NET).






Get cc from eagetmail vb.net