title: Sending mail in Windows mobile application in Windows
body: <p>I am new to Windows Mobile Application. In my project, I want to send emails using <code>microsoft.windowsmobile.pocketoutlook</code>. I have the following code so far:</p>
  
  <pre><code>private void btnsubmit_Click(object sender, EventArgs e)
  {
      try
      { 
          totleave();
          OutlookSession ol = new OutlookSession();
          EmailMessage em = new EmailMessage();
          //Recipient  s1 = em.From;
          //Console.WriteLine(s1);
          Recipient r = new Recipient("iyalarasi.r", "iyalarasi.r@winxsolutions.com");
          em.To.Add(r);
          em.Subject = "Request For Leave";
          em.BodyText =txtename.Text +"(Emp id:"+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");
          f2.Show();
          f2.lblmsg.Text = "You have Applied Leave";
      }
      catch (PocketOutlookException ex)
      {
          lblmsg1.Text = ex.ToString();
      }
      catch (Exception e1)
      {
          lblmsg1.Text = e1.ToString();
      }
  }
  </code></pre>
  
  <p>With this code, emails appear in the outbox, but never appears in the inbox.
  Using Gmail, It shows the following message:</p>
  
  <blockquote>
    <p>Messages could not be sent. Check that you have network coverage, and that your account information is correct, and then try again.</p>
  </blockquote>
  
  <p>My account information is correct. What is going on?</p>