Подтвердить что ты не робот

Как установить ответ на использование Swiftmailer

Как настроить ответ при использовании Swiftmailer. В документах указана функция setReplyTo(), но без конкретных инструкций по ее использованию.

Любая помощь будет оценена.

4b9b3361

Ответ 2

Для тех, кто испытал ту же растерянность, что и я, вы; вы не можете запустить $recipients->setReplyTo() для Swift_RecipientList, но вы можете сделать это непосредственно для Swift_Message:

$recipients = new Swift_RecipientList;
// this is correct
$recipients->addTo('[email protected]');
// this method does not exist so this does not work
$recipients->addReplyTo('[email protected]');

$message = new Swift_Message($subject, $message, 'text/html');
// you can, however, add the reply-to here like this
$message->setReplyTo('[email protected]');
// and of course sending the e-mail like this with the reply to works
$swift->send($message, $recipients, '[email protected]');