public function send() {
    if (!$this->message->hasSender()) {
      throw new \InvalidArgumentException(
          "Required field sender is not provided.");
    } else if ($this->message->getToSize() == 0 &&
              $this->message->getCcSize() == 0 &&
              $this->message->getBccSize() == 0) {
      throw new \InvalidArgumentException(
          "Neither to, cc or bcc is set - at least one is required.");
    } else if (!$this->message->hasSubject()) {
      throw new \InvalidArgumentException(
          "Required field subject is not provided.");
    } else if (!$this->message->hasTextbody() &&
              !$this->message->hasHtmlbody()) {
      throw new \InvalidArgumentException(
          "Neither a plain-text nor HTML body is provided - at least one is " .
          "required.");
    }

    $response = new VoidProto();
    try {
      ApiProxy::makeSyncCall(
          'mail', 'Send', $this->message, $response);
    } catch(ApplicationError $e) {
      $this->handleApplicationError($e);
    }
  }