office365activesync

ActiveSync SendMail command using 12.1 protocol


I am getting error code 500. and below is my request with https://outlook.office365.com/Microsoft-Server-ActiveSync?cmd=SendMail&User=username@domain.com&DeviceId=A6B9A5DB2E334477B48832011B55F06E&DeviceType=mobile

<?xml version=\"1.0\" encoding=\"utf-8\"?>
<SendMail xmlns=\"ComposeMail:\">
    <ClientId>633724606026842453</ClientId>
    <Mime>From: fakeuser@Contoso.com To: xxxx@gmail.com Cc: Bcc: Subject: From NSync MIME-Version: 1.0 Content-Type: text/plain; charset=\"iso-8859-1\" Content-Transfer-Encoding: 7bit X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 This is the body text.</Mime>
</SendMail>

Content-Type: message/rfc822

Please note i am not converting the request data to base64.

Response :

Header : {
    "Cache-Control" = private;
    "Content-Length" = 1208;
    "Content-Type" = "text/html";
    Date = "Tue, 10 Mar 2015 16:13:51 GMT";
    "MS-Server-ActiveSync" = "15.1";
    Server = "Microsoft-IIS/8.0";
    "X-AspNet-Version" = "4.0.30319";
    "X-BEServer" = BY2PR06MB903;
    "X-BackEndHttpStatus" = 500;
    "X-CalculatedBETarget" = "BY2PR06MB903.namprd06.prod.outlook.com";
    "X-DiagInfo" = BY2PR06MB903;
    "X-FEServer" = SG2PR03CA0034;
    "X-MS-BackOffDuration" = "L/-470";
    "X-Powered-By" = "ASP.NET";
    "request-id" = "54541d26-9bdb-41a4-b7e1-3fddcc4f4915"; }

Response Code : 500

Updated

I have tried 14.1 version in that i am converting the mime text to base64 text and convert the xml to wbxml. I have set content type to application/vnd.ms-sync.wbxml. Now i am getting status code 102 which state invalid WBXML so not sure what wrong with my request.


Solution

  • I finally solved the issue. It was due to in mime data. we need to add \n(new line) for each parameter we are passing.