private void btnsubmit_Click(object sender, EventArgs e) { try { OutlookSession ol = new OutlookSession(); EmailMessage em = new EmailMessage(); em.To.Add(new Recipient("iyal", "iyalarasi.r@winxsolutions.com")); em.Subject = "Request For Leave"; em.BodyText = txteno.Text + "request" + cb1.SelectedItem.ToString() + "leave for" + txtreason.Text; // EmailAccount ea = ol.EmailAccounts[0]; em.Send("iyalarasi");//outlook Account Name MessagingApplication.Synchronize("iyalarasi"); MessageBox.Show("mail sent"); Form2 f2 = new Form2(); f2.Show(); f2.lblmsg.Text = "You have Applied Leave"; } catch (PocketOutlookException ex) { lblmsg1.Text = ex.ToString(); } catch (Exception e1) { lblmsg1.Text = e1.ToString(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)