When I try to add attachments using this method:
public void sendMail_VendorsWithEmail(string TO,string SUBJECT,string ATTACHMENTS)
{
/*this method creates an outlook email object
* attaches a file to it and email it out to the apporpriate vendor with emails
*/
string body=this.getEmailBody();
//creating oulook application class
Application outlook_app = new ApplicationClass();
//creatin message item
MailItem mail_msg = (MailItem)outlook_app.CreateItem(OlItemType.olMail Item);
//email fields
mail_msg.To = TO;
mail_msg.Subject = SUBJECT;
mail_msg.Body = body;
mail_msg.Attachments=ATTACHMENTS ;
//sending email
mail_msg.Send();
}
I get the following error msgs:
Property or indexer 'Microsoft.Office.Interop.Outlook._MailItem.Attach ments' cannot be assigned to -- it is read only Outlook_EmailSender_App
Cannot implicitly convert type 'string' 'Microsoft.Office.Interop.Outlook.Attachments'
what am I doing wrong?