public function setSubject($subject) {
    if (!is_string($subject)) {
      $error = sprintf("Subject given is not a string (Actual type: %s).",
               gettype($subject));
      throw new \InvalidArgumentException($error);
    }
    $this->message->setSubject($subject);
  }
public function setSubject($subject) {
    if (!is_string($subject)) {
      $error = sprintf("Subject given is not a string (Actual type: %s).",
               gettype($subject));
      throw new \InvalidArgumentException($error);
    }
    $this->message->setSubject($subject);
  }
public function setSubject ( $ subject ) { if ( ! is_string ( $ subject ) ) { $ error = sprintf ( "Subject given is not a string (Actual type: %s)." , gettype ( $ subject ) ) ; throw new \ InvalidArgumentException ( $ error ) ; } $ this -> message -> setSubject ( $ subject ) ; }
Sets the subject for the mail object.

@param string $subject Subject line.
@throws \InvalidArgumentException If subject line is not a string.
Sets the subject for the mail object .