Skip to content
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

Fix SmtpService to validate email address #12253

Merged
merged 5 commits into from
Sep 1, 2022

Conversation

MikeAlhayek
Copy link
Member

Fix #12252

var mimeMessage = FromMailMessage(message);
var errors = new List<LocalizedString>();

var mimeMessage = FromMailMessage(message, errors);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if errors should be part of FromMailMessage method? may be just create IsValid method separate from FromMailMessage method

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ns8482e this is how the class was designed. All we did here is create more checks to ensure we report proper error instead of throwing exception

@sebastienros
Copy link
Member

"Invalid {0} email." -> "Invalid email address: '{0}'" this way only one string is translated, and users can see what actual address is wrong.

@MikeAlhayek
Copy link
Member Author

@sebastienros fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected expection thrown when testing the email settings with an invalid email
3 participants