xhit / go-simple-mail

Golang package for send email. Support keep alive connection, TLS and SSL. Easy for bulk SMTP.
MIT License
650 stars 102 forks source link

Discarding duplicate email address and setting error #70

Closed aayush-sib closed 1 year ago

aayush-sib commented 1 year ago

Hi Thanks for creating this package, great work 👍

I wanted to know if is there any specific reason why you are not adding a duplicate email address in recipients and setting error on email also?

email.recipients, err = addAddress(email.recipients, address.Address)
    if err != nil {
        email.Error = errors.New("Mail Error: " + err.Error() + "; Header: [" + header + "] Address: [" + addresses[i] + "]")
        return email
xhit commented 1 year ago

Hi

Internal requirement, maybe export a new variable to disable the check to be used for developers will provide what do you need without to do a breaking change.

aayush-sib commented 1 year ago

Yes, that will be of great help if something like this can be added. Can you please release a tag with that? I need to use it in my project and it is breaking at this point. If you are busy with some project I can also raise a PR for the same if you can review and take it forward quickly.

xhit commented 1 year ago

Perfect! Please make a PR, I have time to review and make the release in Github

mukul-brevo commented 1 year ago

Hi @xhit

I have raised PR for above fix, please have a look.