I am trying to send an email with several recipients. On most machines, the program works as expected, but on one I get the following error. System.Runtime.InteropServices.COMException (0x80004005): Outlook does not recognize one or more names.
I have narrowed down what address the machine thinks is the issue and there is nothing wrong with it.
I have tried using using both the recipients and To fields as follows:
Outlook.MailItem outLookMsg = outlookApp.CreateItem(Outlook.OlItemType.olMailItem);
Outlook.Recipients recips = outLookMsg.Recipients;
Outlook.Recipient recip = recips.Add("'doesntWork@test.com'");
recip.Type = OlMailRecipientType.olTo;
outLookMsg.Send()
As well as
Outlook.MailItem outLookMsg = outlookApp.CreateItem(Outlook.OlItemType.olMailItem);
outLookMsg.To = "'doesntWork@test.com'";
outLookMsg.Send()
I have tried forcing the program to use the literal email address without resolving by using 'doesntwork@test.com' with and without the single quotes, but that does not work. I really don't want outlook to try and resolve the recipient, I just want it to send the email. Anyone run into this before?
User contributions licensed under CC BY-SA 3.0