File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -149,18 +149,20 @@ public function message(): MimeMessage
149149 public function reply (Mailable $ mailable )
150150 {
151151 if ($ mailable instanceof \Illuminate \Mail \Mailable) {
152- if (app ()->version () >= 9 ) {
153- $ mailable ->withSwiftMessage (function (\Swift_Message $ message ) {
154- $ message ->getHeaders ()->addIdHeader ('In-Reply-To ' , $ this ->id ());
152+ $ usesSymfonyMailer = version_compare (app ()->version (), '9.0.0 ' , '> ' );
153+
154+ if ($ usesSymfonyMailer ) {
155+ $ mailable ->withSymfonyMessage (function (\Symfony \Component \Mime \Email $ email ) {
156+ $ email ->getHeaders ()->addIdHeader ('In-Reply-To ' , $ this ->id ());
155157 });
156158 } else {
157- $ mailable ->withSymfonyMessage (function (\Swift_Message $ message ) {
159+ $ mailable ->withSwiftMessage (function (\Swift_Message $ message ) {
158160 $ message ->getHeaders ()->addIdHeader ('In-Reply-To ' , $ this ->id ());
159161 });
160162 }
161163 }
162164
163- return Mail::to ($ this ->from ())->send ($ mailable );
165+ return Mail::to ($ this ->headerValue ( ' Reply-To ' ) ?: $ this -> from ())->send ($ mailable );
164166 }
165167
166168 public function forward ($ recipients )
You can’t perform that action at this time.
0 commit comments