无法在Windows Mobile应用程序中发送邮件 [英] Can't send mail in Windows Mobile application

查看:81
本文介绍了无法在Windows Mobile应用程序中发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在开发Windows Mobile应用程序,正在尝试发送邮件,但没有发送邮件

我的代码是



I am developing windows mobile application, and I am trying to send an mail, but it doesn''t send mail

My code is,

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(ea);
             // MessagingApplication.Synchronize("iyalarasi.r@winxsolutions.com");
              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();
          }


我检查了断点,它没有提供任何错误,但我收不到邮件.

请帮助我,我是这个应用程序的新手.并需要立即完成此任务.


I checked with breakpoint,It doesn''t provide any error,but i can;t receive mail.

Please Help me,I am new to this application. and need finish this task today

推荐答案

请检查您的防火墙设置.

谢谢,
Prashant
Please check your firewall setting.

Thanks,
Prashant


请参阅此示例..然后自己尝试
http://msdn.microsoft.com/en-us/library/bb158768.aspx [ ^ ]
See this example..and try it yourself
http://msdn.microsoft.com/en-us/library/bb158768.aspx[^]


这篇关于无法在Windows Mobile应用程序中发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆