Jonny M
Jonny M

Reputation: 105

outlook mail object bcc

//Create the session.
Outlook.Application application = new Outlook.Application();
//Create the session.                        
Outlook.MailItem mail = application.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
//create the receipents object
Outlook.Recipients objOutlookRecip = mail.Recipients;

while (Recipients.Read())
{
    mail.Subject = Confirmations.GetString(2);
    mail.Body = Confirmations.GetString(4) + ("\r\n");        
    mail.Body = mail.Body + ("\r\n") + Confirmations.GetString(5) +     ("\r\n");
    mail.Body = mail.Body + ("\r\n") + Confirmations.GetString(6);
    mail.SentOnBehalfOfName = "[email protected]";
    mail.Recipients.Add(Recipients.GetString(8));
}

Does anyone know how i might be able to insert the email addresses into bcc instead of the current process in the to field

Upvotes: 1

Views: 733

Answers (1)

Damith
Damith

Reputation: 63105

Outlook.Recipient recipBcc =
        mail.Recipients.Add(Recipients.GetString(8));
recipBcc.Type = (int)Outlook.OlMailRecipientType.olBCC;

check OlMailRecipientType Enumeration

Upvotes: 1

Related Questions