I’m using .NET 3.5, and I want to automatically send a mail. I’m currently using the following:
Microsoft.Office.Interop.Outlook.MailItem mailMsg =
(Microsoft.Office.Interop.Outlook.MailItem)outlookApplication.CreateItem(
Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
mailMsg.To = recipient;
mailMsg.Subject = subject;
mailMsg.Body = body;
mailMsg.Send();
However, I’ve found several articles that seem to imply I should be using the following method:
System.Net.Mail.MailMessage mailMsg = new System.Net.Mail.MailMessage();
mailmsg.To = recipient;
mailmsg.Subject = subject;
mailmsg.Body = body;
Can anyone tell me what the difference between the two namespaces if, and why you might want to use one over the other?