C# “错误”;xm007错误命令参数11“;在阅读Outlook的电子邮件时

C# “错误”;xm007错误命令参数11“;在阅读Outlook的电子邮件时,c#,email,imap,outlook,C#,Email,Imap,Outlook,我正在使用电子邮件服务,并尝试使用IMAPAe.net.mail获取电子邮件,我能够轻松地阅读来自GMAIL的电子邮件,但当我尝试为Outlook express执行此操作时,会抛出一个异常,如下所示 错误: xm007错误的命令参数11 下面给出了用于身份验证的代码,该代码可以正常工作 ImapClient ic = new ImapClient("outlook.office365.com", MailBoxID, Password, AuthMethods.Login, 993), tr

我正在使用电子邮件服务,并尝试使用IMAPAe.net.mail获取电子邮件,我能够轻松地阅读来自GMAIL的电子邮件,但当我尝试为Outlook express执行此操作时,会抛出一个异常,如下所示

错误:

xm007错误的命令参数11

下面给出了用于身份验证的代码,该代码可以正常工作

ImapClient ic = new ImapClient("outlook.office365.com", MailBoxID, Password, 
AuthMethods.Login, 993), true);

IMAPService im = new IMAPService();
im.LoadExchangeEmail(ic, dtEmailServer.Rows[i]);
现在,当我试图阅读电子邮件时,它给了我一个例外,正如我上面提到的

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;    
using AE.Net.Mail;
using AE.Net.Mail.Imap;
using EmailDownloadService.Library;

namespace EmailDownloadService
{
    public class IMAPService
    {
        public void LoadExchangeEmail(ImapClient ic, DataRow Dt)
        {
            try
            {
                ic.SelectMailbox("Inbox");
                Lazy<MailMessage>[] mm = ic.SearchMessages(SearchCondition.SentSince(Convert.ToDateTime("1/10/2016 11:48:59 AM")), false, true)                         
                InsertIMAP ObjectIMAPInsert = new InsertIMAP();
                ObjectIMAPInsert.InsertEmail(mm, Dt);

                #region "Get email code"
                //foreach (Lazy<MailMessage> message in mm)
                //{
                //    MailMessage m = message.Value;
                //    string FromAddress= m.From.Address;                    
                //}
                #endregion

                ic.Dispose();
            }
            catch (Exception ex)
            {
                ErrorHandling.ErrorLog(string.Format("Method:LoadIMAP, LineNumber:{0}, Source:{1}, Message:{2}", ex.StackTrace, ex.Source, ex.Message));
            }
        }
    }
}
使用系统;
使用System.Collections.Generic;
使用System.Linq;
使用系统文本;
使用System.Threading.Tasks;
使用系统数据;
使用AE.Net.Mail;
使用AE.Net.Mail.Imap;
使用EmailDownloadService.Library;
命名空间EmailDownloadService
{
公共类IMAPService
{
公共无效LoadExchangeMail(ImapClient ic,DataRow Dt)
{
尝试
{
ic.选择邮箱(“收件箱”);
Lazy[]mm=ic.SearchMessages(SearchCondition.SentSince(Convert.ToDateTime(“1/10/2016 11:48:59 AM”)),false,true)
InsertIMAP ObjectMapInsert=新建InsertIMAP();
ObjectIMAPInsert.InsertEmail(mm,Dt);
#区域“获取电子邮件代码”
//foreach(以mm为单位的惰性消息)
//{
//MailMessage m=message.Value;
//字符串FromAddress=m.From.Address;
//}
#端区
ic.Dispose();
}
捕获(例外情况除外)
{
ErrorHandling.ErrorLog(string.Format(“方法:LoadIMAP,行号:{0},源:{1},消息:{2}”,ex.StackTrace,ex.Source,ex.Message));
}
}
}
}
当我试图执行时,在这段代码中

Lazy<MailMessage>[] mm = ic.SearchMessages(SearchCondition.SentSince(Convert.ToDateTime("1/10/2016 11:48:59 AM")), false, true)
Lazy[]mm=ic.SearchMessages(SearchCondition.SentSince(Convert.ToDateTime(“1/10/2016 11:48:59 AM”)),false,true)
它抛出一个异常,如

xm007错误的命令参数11


有人能帮我解决这个问题吗?

IMAP日期-时间语法是DQUOTE日期-天-固定“-”日期-月“-”日期-年SP时区DQUOTE;你一定要明白。没有斜杠,没有AM,没有PM,也没有灵活性。UID之前/之后的搜索更简单:仅天-月-年。没有时间,没有区域,月份是一月/二月/三月/四月/五月/六月/七月/八月/九月/十月/十一月/十二月的缩写,我想。@arnt我试过但无法解决我的问题,你能给我一个例子吗?我怎么写今天的日期?@Max我试过但无法解决我的问题,我想问你今天的日期是怎么写的,我需要一个例子。。。2016年1月12日