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

Toggle to accept incomplete email address #95

Closed meain closed 10 months ago

meain commented 10 months ago

This feature request might not fit the project's goals, but I wanted to check just in case you were open to adding it.

We use this project to generate .eml files out of email data that we have in a different format. During this, it is possible that we might have "incomplete" emails in the To or other similar fields. This usually comes from draft emails where people abandon half way through and a few other reasons.

Currently when we try to encode these emails in to .eml, we end up getting an error usually complaining about a missing @ as the email field might just contain a name or a Microsoft legacyExchangeDN.

The proposal would be to add a toggle similar to email.AllowDuplicateAddress to accept incomplete email addresses. The expected change would be to optionally drop the code for parsing out email address and use the user provided string as is.

xhit commented 10 months ago

Hi, I can work with this today

meain commented 10 months ago

Awesome, I'll drop a PR to allow for incomplete emails.

xhit commented 10 months ago

Oh, perfect, thanks, please send the PR, I will appreciate it.