8000 SES, sendEmail() returns error "Missing '&quote;'" · Issue #1196 · aws/aws-sdk-php · GitHub
[go: up one dir, main page]

Skip to content
SES, sendEmail() returns error "Missing '&quote;'" #1196
Closed
@LionelMarbot

Description

@LionelMarbot

Hi,

We are using SES to send our emails and it is working fine. However, there is one particular scenario where sending would just not work. It is when we use following "Source":

$from = 'foo@bar.com';
$name = 'Encuesta "Mejora del Desempeño del Agente de Servicio"';
//                ^                  ^                        ^
//          first quote      special character           second quote

$source = mb_encode_mimeheader($name) . " <{$from}>";

Trying to send an email will return following error from AWS:

Error executing "SendEmail" on "https://email.eu-west-1.amazonaws.com"; AWS HTTP error: Client error: `POST https://email.eu-west-1.amazonaws.com` resulted in a `400 Bad Request` response:
<ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <Error>
    <Type>Sender</Type>
    <Code>InvalidPara (truncated...)
 InvalidParameterValue (client): Missing '"' - <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <Error>
    <Type>Sender</Type>
    <Code>InvalidParameterValue</Code>
    <Message>Missing '&quot;'</Message>
  </Error>
  <RequestId>5f791426-f927-11e6-a07e-2d6929f5e69d</RequestId>
</ErrorResponse>

AWS Request ID: 5f791426-f927-11e6-a07e-2d6929f5e69d

The problem seems to be that $source evaluates to this:

Encuesta "Mejora del =?UTF-8?B?RGVzZW1wZcOxbyBkZWwgQWdlbnRlIGRlIFNlcnZp?= =?UTF-8?B?Y2lvIg==?= <foo@bar.com>

The part before the ñ is not being encoded, while everything afterwards is. Because of this, the first quote is still there, but the second quote is gone (encoded).

Is this a bug on AWS' side? Or can we solve this somehow?

Best,
Lionel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0