Пример #1
0
    public void SendEmail( String subject, BodyParts bodyParts, List<String> recipients, List<String> attachments,
                           AsyncCallback<object> responder )
    {
      if( subject == null )
        throw new ArgumentNullException( ExceptionMessage.NULL_SUBJECT );

      if( bodyParts == null )
        throw new ArgumentNullException( ExceptionMessage.NULL_BODYPARTS );

      if( recipients == null || recipients.Count == 0 )
        throw new ArgumentNullException( ExceptionMessage.NULL_RECIPIENTS );

      if( attachments == null )
        throw new ArgumentNullException( ExceptionMessage.NULL_ATTACHMENTS );

      Invoker.InvokeAsync( EMAIL_MANAGER_SERVER_ALIAS, "send", new Object[] { Backendless.AppId, Backendless.VersionNum, subject, bodyParts, recipients, attachments }, responder );
    }
Пример #2
0
 public void SendEmail( String subject, BodyParts bodyParts, String recipient, AsyncCallback<object> responder )
 {
   SendEmail( subject, bodyParts, new List<String>() { recipient }, new List<String>(), responder );
 }
Пример #3
0
 public void SendEmail( String subject, BodyParts bodyParts, String recipient, List<String> attachments )
 {
   SendEmail( subject, bodyParts, new List<String>() { recipient }, attachments );
 }
Пример #4
0
 public void SendEmail( String subject, BodyParts bodyParts, String recipient )
 {
   SendEmail( subject, bodyParts, new List<String>() { recipient }, new List<String>() );
 }
Пример #5
0
        public void SendEmail(String subject, BodyParts bodyParts, List<String> recipients, List<String> attachments,
            AsyncCallback<object> responder)
        {
            if (subject == null)
            throw new ArgumentNullException(ExceptionMessage.NULL_SUBJECT);

              if (bodyParts == null)
            throw new ArgumentNullException(ExceptionMessage.NULL_BODYPARTS);

              if (recipients == null || recipients.Count == 0)
            throw new ArgumentNullException(ExceptionMessage.NULL_RECIPIENTS);

              if (attachments == null)
            throw new ArgumentNullException(ExceptionMessage.NULL_ATTACHMENTS);

              Dictionary<string, object> requestData = new Dictionary<string, object>();
              requestData.Add("subject", subject);
              requestData.Add("bodyparts", bodyParts);
              if (recipients.Count > 0)
            requestData.Add("to", recipients);
              if (attachments.Count > 0)
            requestData.Add("attachment", attachments);

              Invoker.InvokeAsync(Invoker.Api.MESSAGINGSERVICE_SENDEMAIL, new Object[] { requestData }, responder);
        }