private void SetRecipient(GXMailRecipientCollection gXMailRecipientCollection, EmailAddressCollection emailAddressCollection) { foreach (var to in emailAddressCollection) { gXMailRecipientCollection.Add(new GXMailRecipient(to.Name, to.Address)); } }
private void CopyRecipients(Recipients fromList, GXMailRecipientCollection toList, RecipientType type) { GXLogging.Debug(log, "Copying Recipients: " + type); for (int i = 1; i <= fromList.Count; i++) { Recipient recipient = fromList[i]; if (recipient.Type == (int)type) { toList.Add(new GXMailRecipient(recipient.Name, recipient.Address)); } } }
private void CopyRecipients(Recipients fromList, GXMailRecipientCollection toList, RecipientType type) { GXLogging.Debug(log, "Copying Recipients: " + type); for (int i = 1; i <= (int)fromList.Count; i++) { Recipient recipient = (Recipient)fromList.get_Item(i); if (((int)recipient.Type) == (int)type) { toList.Add(new GXMailRecipient(recipient.Name.ToString(), recipient.Address.ToString())); } } }
public void SetMessageRecipients(GXMailRecipientCollection recipients, string type) { string recsStr = GetField(type); if (!string.IsNullOrEmpty(recsStr)) { bool inQuotes = false; List <String> recPartList = new List <string>(); StringBuilder part = new StringBuilder(); foreach (char c in recsStr) { if (c == '"') { inQuotes = !inQuotes; } if ((c == ';' || c == ',') && !inQuotes) { recPartList.Add(part.ToString()); part = new StringBuilder(); } else { part.Append(c); } } if (part.Length > 0) { recPartList.Add(part.ToString()); } foreach (string recipient in recPartList) { if (!string.IsNullOrEmpty(recipient.Trim())) { string[] recipParts = GetMessageRecipient(recipient); recipients.Add(new GXMailRecipient(recipParts[0], recipParts[1])); } } } }