Closed meain closed 10 months ago
@xhit Quick question. I saw that you were using address.Address
at certain places and address.String()
at other. Is there a reason why we are doing it differently at different places.
If we use address.String()
at all the paces, I think https://github.com/xhit/go-simple-mail/issues/11 also gets handled.
@meain address.Address
contains only the email, with this we add to recipients to send a SMTP RCPT
command because we only need the address here. The address.String()
is the full address, with the name if provided, and the address enclosed by <
and >
, used to create a RFC822 formatted message to use un SMTP DATA
command, also, dev can get it using GetMessage
method.
Not all addresses in the message are populated by default, the BCC for example, are added to recipients for the RCPT
command, but not in the message for the DATA
command for security, with this, the recipients will not know the BCC addresses.
address.Address
contains only the email, with this we add to recipients to send aSMTP
RCPT
command because we only need the address here.
Hmm, I see. Would you be open to changing it to accepting the full address. Would it cause issues?
Hmm, I see. Would you be open to changing it to accepting the full address. Would it cause issues?
I can't, RCPT only receives the address, not full address.
Attention: 8 lines
in your changes are missing coverage. Please review.
Comparison is base (
3a06b6e
) 52.51% compared to head (c70ebcd
) 52.65%.
Files | Patch % | Lines |
---|---|---|
email.go | 60.00% | 7 Missing and 1 partial :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@xhit Following our discussion, I've added a note in the readme and rebased the code on latest master. Let me know if you need anything else from the PR.
@meain sorry, I'm currently on vacations, I will tag a new version after that, you can use master branch. Thanks!
Thanks @xhit. No rush on the tag :D
This PR adds an option
UseProvidedAddress
which when set directly uses the email provided by the user without validating or trying to parse out its components.Closes https://github.com/xhit/go-simple-mail/issues/95