Kitura / Swift-SMTP

Swift SMTP client
Apache License 2.0
260 stars 60 forks source link

Feature Request - Reply To #118

Open willm132 opened 3 years ago

willm132 commented 3 years ago

Is there a way to set a reply to email. So if the user who got an email clicks reply it can be set to another email address?

mbarnach commented 3 years ago

Hi @willm132,

I can't find the SMTP closure for Reply-To. Do you have any relevant documentation we could look at?

If you are able to make a PR (directly), we will look at it!

Thanks.

willm132 commented 3 years ago

@mbarnach I was wondering if this is a feature that is already included or can be added. I used to use this package a few years ago before it stopped being support. It allowed you to send from one email, then specify a reply to a different email. So I can send a customer an email, if they click reply it will be sent to a different email.

mbarnach commented 3 years ago

From the code, it seems that the closure is Reply-to:. It should work if we add the command to https://github.com/Kitura/Swift-SMTP/blob/master/Sources/SwiftSMTP/Command.swift and the needed field in https://github.com/Kitura/Swift-SMTP/blob/master/Sources/SwiftSMTP/Mail.swift Then extending https://github.com/Kitura/Swift-SMTP/blob/master/Sources/SwiftSMTP/MailSender.swift should be easy. Do you feel like doing such PR (with tests ideally). I can review it! If you have any RFC references, that would also be great, to know if this is a standard feature or that it may not work everywhere.

Thanks.

willm132 commented 3 years ago

@mbarnach Unfortunately I wouldn't have any idea on how to do that.

mbarnach commented 3 years ago

Too bad! I will see if I can have a look at it.

sbeitzel commented 2 years ago

This seems kind of weird. I mean, if it's just sticking a 'Reply-To' header on the message, why not do that? Is it true that only known headers get sent? What if the client who's using the library wants to include something special, like, 'X-Client-Signature' in the message headers?