Answer the question
In order to leave comments, you need to log in
How to set return-path when sending email?
Letters are sent through the built-in library swiftmailer
added ->setReturnPath(Yii::$app->params['email'])
But I don't see this email in the headers of the received letter, more precisely, it's empty where the return-path is configured on the server or all the same through script can be set? Or does Exim remove it on send?
Answer the question
In order to leave comments, you need to log in
1. And why did you decide that the matter is in swiftmailer or in its setReturnPath method? The first thing I would pay attention to is Yii::$app->params['email']
, most likely it is empty there.
2. Would you show the full send code. Just in case.
stop, use it instead .
Since it returns a MessageInterface , and it does not have a setReturnPath method
. I think You have error output turned off otherwise you would have received it and not wasted so much time looking for a problem. Yii::$app->mailer->compose()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question