Skip to content

Handling special ASCII characters in FromName #78

@coel

Description

@coel

I discovered if the FromName contains a comma the email was being rejected by our SMTP server. Doing more testing, I could see double quotes being stripped out and angle brackets also causing the email to be rejected.

Looking at RFC 5322 it seems like this display-name can be a quoted-string when it contains any of the specials.

In my case I escaped with a backslash any existing backslashes and double quotes, then wrapped the whole string in double quotes. It would be nice if the library handled this (though it would mean my code will cause extra characters to be sent 😅).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions