Click here to Skip to main content
16,018,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I am developing smart device application in .net,I am deploying that application in windows mobile professional6.5.3.
I want to send mail in that, my code is
C#
private void btnsubmit_Click(object sender, EventArgs e)
       {
           try
           {


               //txtfrom.Text = dtpfrom.Value.ToShortDateString();
               //txtto.Text = dtpto.Value.ToShortDateString ();
               int tot=Convert.ToInt16( (dtpto.Value - dtpfrom.Value).TotalDays);
               MessageBox.Show ("total leave is" + tot.ToString ());

               OutlookSession ol = new OutlookSession();
               EmailMessage em = new EmailMessage();
               Recipient r = new Recipient("Iyalarasi.R", "iyalarasi.r@winxsolutions.com");
               em.To.Add(r);
               em.Subject = "Request For Leave";
               em.BodyText =txtename.Text +"("+txteno.Text+ ")" + "request"+ cb1.SelectedItem.ToString()+" leave from "+dtpfrom .Value .ToShortDateString ()+"to"+dtpto .Value.ToShortDateString ()  + "\n The reason is" + txtreason.Text;
               EmailAccount ea = ol.EmailAccounts[0];
               ea.Send(em);
               // em.Send("iyalarasi.r");//Account name in outlook
               //MessagingApplication.Synchronize("iyalarasi.r");
               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();
           }

       }


In that after press send button, In my mobile outlook, the outbox contain mail that what i have sent. But in my inbox in outlook doesn't contain that mail why?

and I have one more doubt,that how can we send mail from mobile device to computer?

Please help me soon.

I am confusing with this for past 1 week.
Posted
Updated 22-Oct-12 1:00am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900