Skip to main content
edited body
Source Link
Ken
  • 3.2k
  • 4
  • 27
  • 30

For those who experienced the same confusion as me you;, you are not able to run $recipients->setReplyTo() on a Swift_RecipientList but you are able to do so on the Swift_Message directly:

$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]'); 

For those who experienced the same confusion as me you; are not able to run $recipients->setReplyTo() on a Swift_RecipientList but you are able to do so on the Swift_Message directly:

$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]'); 

For those who experienced the same confusion as me, you are not able to run $recipients->setReplyTo() on a Swift_RecipientList but you are able to do so on the Swift_Message directly:

$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]'); 
Source Link
Ken
  • 3.2k
  • 4
  • 27
  • 30

For those who experienced the same confusion as me you; are not able to run $recipients->setReplyTo() on a Swift_RecipientList but you are able to do so on the Swift_Message directly:

$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]');