jamesmh / coravel

Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze!
https://docs.coravel.net/Installation/
MIT License
3.63k stars 243 forks source link

SMTPMailer adding ReplyTo in SMTP message header #358

Closed riex406 closed 3 months ago

riex406 commented 4 months ago

This is for issue #357.

The reply to address is passed to the SendAysnc method but was not applied to the MimeMessage generated. This should be a non breaking change where if no ReplyTo address is supplied it is not added, while when a ReplyTo message is supplied it is added in the email header appropriately.

I tried making some unit tests but couldn't without adding a lot of extra code or packages.

jamesmh commented 4 months ago

Love it. If you look at the file Src/UnitTests/MailerUnitTests/Mail/SmtpMailerTests.cs, in the SmtpMailerRenderSucessful test, could you add a call to the fluent method ReplyTo?

This wouldn't test whether the SMTP protocol actually has the reply to field set, but it at least tests the mailable API to ensure it's okay up to the point before the email is actually sent off.

riex406 commented 4 months ago

I fixed the extra space issue, and I also added another unit test that calls the ReplyTo fluent method.