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

Entering a "From" property can cause "illegal email address" exceptions #61

Open
KoanLeeroy opened this issue Jul 16, 2018 · 0 comments

Comments

@KoanLeeroy
Copy link

If you enter a message From property formatted like this:

message.From = $"{model.FromName} <{model.FromEmail}>";
AND
model.FromName is a string with a value with a comma in it, the Postmark API fails.

The fix in this instance is to double quote the from name portion. Technically this should only be done when required according to the spec (RFC5322 https://tools.ietf.org/html/rfc5322#section-3.6.2)

Really this is the job of the SDK in my opinion. This would lead to less runtime issues.

A kinder SDK interface would look something like this...
message.From = new Postmark(model.FromName, model.FromEmail);

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

No branches or pull requests

1 participant