My friend and I have been developing a desktop application that would have a mail sending option. Here's the code that we have (and it's working for 1 person).
status = MessageBox.Show("Some message", "Info", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
if (status == DialogResult.OK)
// Create the Outlook application.
Outlook.Application oApp = new Outlook.Application();
// Create a new mail item.
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
// Set HTMLBody.
//add the body of the email
oMsg.HTMLBody = "" +
"some html text" +
int iPosition = (int)oMsg.Body.Length + 1;
oMsg.Subject = txt_mailKonu.Text;
oMsg.Importance = Outlook.OlImportance.olImportanceHigh;
Outlook.Recipients oRecips = (Outlook.Recipients)oMsg.Recipients;
//Following line causes the problem
Outlook.Recipient oRecip = (Outlook.Recipient)oRecips.Add(senderForm.getRecipientList().ToString());
// Clean up.
oRecip = null;
oRecips = null;
oMsg = null;
oApp = null;
But when we throw in multiple email addresses it keeps giving us this error: COM Exception - Outlook cannot resolve one or more names. What should we do here?