Application oApp = new Application(); MailItem oMailItem = (MailItem)oApp.CreateItem(OlItemType.olMailItem); oMailItem.Recipients.Add(toTxtBox.Text); oMailItem.CC = ccTxtBox.Text; oMailItem.Subject = sbjTxtBox.Text; string x =""; string date = Session["date"].ToString(); string to = Session["to"].ToString(); string subject = Session["subject"].ToString(); oMailItem.HTMLBody = bodyTxtBox.Text + getEmailFile(x); if (FileUpload1.HasFile) { int AttachType = (int)OlAttachmentType.olByValue; Attachment Attach = oMailItem.Attachments.Add(FileUpload1.PostedFile.FileName, AttachType, Type.Missing, Type.Missing); } ((Microsoft.Office.Interop.Outlook._MailItem)oMailItem).Send();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)