Setting reply-to, name for sending an email

So I looked at the mailing code in Yii




Yii::$app->mailer->compose()

    ->setFrom('email@email.com')

    ->setTo($email)

    ->setSubject('Contest confirmation')

    ->setTextBody('Plain text content')

    ->setHtmlBody('<b>HTML content</b>')

    ->send();



But how do I set the name of the sender and also the reply-to email? Or is that possible?

Use array for ‘setFrom’ :


Yii::$app->mailer->compose()

    ->setFrom(['email@email.com', 'name'])

    ->setTo($email)

	->[i]setReplyTo($reply-to)[/i]

    ->setSubject('Contest confirmation')

    ->setTextBody('Plain text content')

    ->setHtmlBody('<b>HTML content</b>')

    ->send();

And use ‘setReplyTo’.

See http://swiftmailer.org/docs/sending.html