title: EWS The server cannot service this request right now
body: <p>I am seeing errors while exporting email in office 365 account using ews managed api, "The server cannot service this request right now.  Try again later."  Why is that error occurring and what can be done about it?</p>
  
  <p>I am using the following code for that work:-</p>
  
  <pre><code>          _GetEmail = (EmailMessage)item;
             bool isread = _GetEmail.IsRead;
             sub = _GetEmail.Subject;
             fold = folder.DisplayName;
             historicalDate = _GetEmail.DateTimeSent.Subtract(folder.Service.TimeZone.GetUtcOffset(_GetEmail.DateTimeSent));
                                  props = new PropertySet(EmailMessageSchema.MimeContent);
                                  var email = EmailMessage.Bind(_source, item.Id, props);
  
                                  bytes = new byte[email.MimeContent.Content.Length];
                                  fs = new MemoryStream(bytes, 0, email.MimeContent.Content.Length, true);
                                  fs.Write(email.MimeContent.Content, 0, email.MimeContent.Content.Length);
  
                                  Demail = new EmailMessage(_destination);
                                  Demail.MimeContent = new MimeContent("UTF-8", bytes);
  
                                  // 'SetExtendedProperty' used to maintain historical date of items
                                  Demail.SetExtendedProperty(new ExtendedPropertyDefinition(57, MapiPropertyType.SystemTime), historicalDate);
                                  // PR_MESSAGE_DELIVERY_TIME 
                                  Demail.SetExtendedProperty(new ExtendedPropertyDefinition(3590, MapiPropertyType.SystemTime), historicalDate);
                                  if (isread == false)
                                  {
                                      Demail.IsRead = isread;
                                  }
  
                                  if (_source.RequestedServerVersion == flagVersion &amp;&amp; _destination.RequestedServerVersion == flagVersion)
                                  {
                                      Demail.Flag = _GetEmail.Flag;
                                  }
  
                                  _lstdestmail.Add(Demail);
  
                                  _objtask = new TaskStatu();
                                  _objtask.TaskId = _taskid;
                                  _objtask.SubTaskId = subtaskid;
                                  _objtask.FolderId = Convert.ToInt64(folderId);
                                  _objtask.SourceItemId = Convert.ToString(_GetEmail.InternetMessageId.ToString());
                                  _objtask.DestinationEmail = Convert.ToString(_fromEmail);
                                  _objtask.CreatedOn = DateTime.UtcNow;
                                  _objtask.IsSubFolder = false;
                                  _objtask.FolderName = fold;
                                  _objdbcontext.TaskStatus.Add(_objtask);
                                  try
                                  {
                                      if (counter == countGroup)
                                      {
                                          Demails = new EmailMessage(_destination);
                                          Demails.Service.CreateItems(_lstdestmail, _destinationFolder.Id, MessageDisposition.SaveOnly, SendInvitationsMode.SendToNone);
                                          _objdbcontext.SaveChanges();
                                          counter = 0;
                                          _lstdestmail.Clear();
                                      }
                                  }
  
                                  catch (Exception ex)
                                  {
                                      ClouldErrorLog.CreateError(_taskid, subtaskid, ex.Message + GetLineNumber(ex, _taskid, subtaskid), CreateInnerException(sub, fold, historicalDate));
                                      counter = 0;
                                      _lstdestmail.Clear();
                                      continue;
                                  }
  </code></pre>
  
  <p>This error occurs only if try to export in office 365 accounts and works fine in case of outlook 2010, 2013, 2016 etc..</p>