-
Notifications
You must be signed in to change notification settings - Fork 582
Allows users to submit rfc822 formatted email addresses #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like there is already an implementation in The constructor for EmailAddress could be updated to call this method, adding support: /// <summary>
/// Initializes a new instance of the <see cref="EmailAddress"/> class.
/// </summary>
/// <param name="email">The email address of the sender or recipient.</param>
/// <param name="name">The name of the sender or recipient.</param>
public EmailAddress(string email, string name = null)
{
if (name == null)
{
var address = MailHelper.StringToEmailAddress(email);
this.Email = address.Email;
this.Name = address.Name;
}
else
{
this.Email = email;
this.Name = name;
}
} Thoughts? |
@thinkingserious I can submit a PR with the change suggested above regarding |
That would be great, thanks @Niladri24dutta! |
@thinkingserious just an observation regarding the above approach ,
To overcome this have created a new overload of the
Let me know your view on this before I proceed. Here is my working branch https://github.com/Niladri24dutta/sendgrid-csharp/tree/RFC822CompliantEmailSupport |
How about factoring out this part:
Then you could just call the factored method internally without the cyclic dependency. With Best Regards, Elmer |
@thinkingserious Then,do we need to create a new helper method in
However,we can change the return type of the |
I think you can encapsulate that check into a utility function, for example, maybe |
Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you! |
Issue Summary
Similar to: sendgrid/sendgrid-python#348
Where the user can submit email addresses as:
[email protected]
or
example example <[email protected]>
The text was updated successfully, but these errors were encountered: