private void CreateMailItem() { //MessageBox.Show(name); string body = "Customer Name : " + lblName.Text + Environment.NewLine + "Legal ID: " + lblLegal.Text + Environment.NewLine + "Card Number: " + lblCard.Text + Environment.NewLine + "Product: " + lblProduct.Text + Environment.NewLine + "Source: " + lblSource.Text + Environment.NewLine + "Interested: " + lblInterest.Text + Environment.NewLine + "Available Balance: " + lblInterest.Text + Environment.NewLine + "Remarks: " + lblInterest.Text + Environment.NewLine + "Staff ID: " + Environment.UserName.ToString(); Outlook.Application app = new Outlook.Application(); Outlook.MailItem mailItem = app.CreateItem(Outlook.OlItemType.olMailItem); mailItem.Subject = "This is the subject"; mailItem.To = "*****@*****.**"; crosssell cro = new crosssell(); mailItem.Body = ""; //mailItem.Attachments.Add(logPath);//logPath is a string holding path to the log.txt file mailItem.Importance = Outlook.OlImportance.olImportanceHigh; mailItem.Display(true); }
private void CreateMailItem() { //MessageBox.Show(name); source = Source().ToString(); if (txtCardNo.Text != "") { cust = txtName.Text; } else { cust = legalID; } if (interested == "Yes") { status = " is interested in "; } else { status = " rejected the offer of "; } string subject = cust + status + product; string body = "Customer Name : " + txtName.Text + Environment.NewLine + "Legal ID: " + legalID + Environment.NewLine + "Card Number: " + txtCardNo.Text + Environment.NewLine + "Product: " + product + Environment.NewLine + "Source: " + Source().ToString() + Environment.NewLine + "Interested: " + interested + Environment.NewLine + "Available Balance: " + txtAvailable.Text + Environment.NewLine + "Remarks: " + txtCriteriaRemarks.Text + Environment.NewLine + "Staff ID: " + Environment.UserName.ToString(); Outlook.Application app = new Outlook.Application(); Outlook.MailItem mailItem = app.CreateItem(Outlook.OlItemType.olMailItem); mailItem.Subject = subject; mailItem.To = "CCC Sales Support"; //mailItem.To = "179264"; crosssell cro = new crosssell(); mailItem.Body = body; //mailItem.Attachments.Add(logPath);//logPath is a string holding path to the log.txt file //mailItem.Importance = Outlook.OlImportance.olImportanceHigh; mailItem.Send(); }
private void criteria_Load(object sender, EventArgs e) { crosssell cro = new crosssell(); cro.Show(); }