/**
* Adds recipients for this mail
*
* @param string $mail Mail address of the recipient
* @param string $name Name of the recipient
* @param string $type How should the recipient receive the mail? ('to', 'cc', 'bcc')
*
* @return void
*
* @since 4.0.0
*/
public function addRecipient($mail, $name = null, $type = 'to')
{
$recipient = new \stdClass();
$recipient->mail = $mail;
$recipient->name = $name ?? $mail;
$recipient->type = $type;
$this->recipients[] = $recipient;
}