ActiveCampaign / postmark-dotnet

A .NET library for the Postmark API

Home Page:http://developer.postmarkapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

KoanLeeroy opened this issue · comments

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);

Did anything ever get updated for this? We recently ran into this issue as well, but it was on version 4.5.2.

@soatley As far as I know nothing changed, if you have any issues please contact our support with more details.
Regarding the comma in display-name - according to the rfc5322 comma is not allowed in not quoted-string