emailhaskellamazon-sesmime-mail

How do I send an email via mime-mail-ses which has a proper "from" name?


The SES data type has the sesFrom field. Everywhere on the Internet I see that I should write something like "\"My Name\" <mymail@gmail.com>" in order to display My Name in the "from" field. But when I put this into the sesFrom field I get

Not sent due to SESException {seStatus = Status {statusCode = 400, statusMessage = "Bad Request"}, seCode = "InvalidParameterValue", seMessage = "Missing '<'", seRequestId = "acf8bb7d-0440-11e8-94c8-45570c829243"}

I checked sources and all seems to be fine there. How do I set the sesFrom field, so a name is displayed?


Solution

  • OK, got it. Instead of writing "\"My Name\" <mymail@gmail.com>" :: Address and relying on OverloadedStrings one should write

    Address (Just "Ny Name") "mymail@gmail.com"
    

    I'd say the library should parse "\"My Name\" <mymail@gmail.com>" into that address, but whatever.