title: How to implement List-Unsubscribe header in emails sent by AWS SES with the PHP SDK
body: <p>I was trying to add a custom header using the AWS PHP SDK so I can implement the "List-unsubscribe" header.<br/>
  The problem is that I cannot find anywhere how to implement it.<br/><br/>
  I've read the documentation but nothing.<br/>
  <a href="http://docs.aws.amazon.com/aws-sdk-php/v2/api/class-Aws.Ses.SesClient.html#_sendEmail" rel="nofollow">http://docs.aws.amazon.com/aws-sdk-php/v2/api/class-Aws.Ses.SesClient.html#_sendEmail</a>
  <br/><br/>
  What am I doing wrong?<br/>
  Thanks in advance for any help provided.
  <br/><br/>
  </p>
  
  <pre><code>require_once("./AWS/aws-sdk/aws-autoloader.php");
  
  $config = array('credentials' =&gt; array('key' =&gt; $awsKey,
                                         'secret' =&gt; $awsSecret),
                  'version' =&gt; 'latest',
                  'region' =&gt; 'us-east-1');
  
  $client = \Aws\Ses\SesClient::factory($config);
  
  $to = 'test@example.com';
  $from = 'testfrom@example.com';
  $subject = 'This is a test';
  $text= 'This is a test';
  $html= 'This is a &lt;b&gt;test&lt;/b&gt;';
  $replyTo = 'replyto@example.com';
  
  $message=array(
      // Source is required
      'Source' =&gt; $from,
  
      // Destination is required
      'Destination' =&gt; array('ToAddresses' =&gt; array($to)),
  
      // Message is required
      'Message' =&gt; array(
          // Subject is required
          'Subject' =&gt; array(
              // Data is required
              'Data' =&gt; $subject,
              'Charset' =&gt; 'UTF-8',
          ),
          // Body is required
          'Body' =&gt; array(
              'Text' =&gt; array(
                  // Data is required
                  'Data' =&gt; $text,
                  'Charset' =&gt; 'UTF-8',
              ),
              'Html' =&gt; array(
                  // Data is required
                  'Data' =&gt; $html,
                  'Charset' =&gt; 'UTF-8',
              ),
          ),
      ),
  
      // reply To..
      'ReplyToAddresses' =&gt; array($replyTo),
  
      // Is this correct??
      'AddHeaderAction' =&gt; array('header_name'=&gt; "List-Unsubscribe",
                                 'header_value'=&gt; urlencode('&lt;unsubscribeme@example.com&gt;')));
  
  try
  {
      $result = $client-&gt;sendEmail($message);
      $messageID=$result-&gt;get('MessageId');
  }
  catch (Exception $response)
  {
      die('error');
  }
  
  echo 'message sent: '. $messageID;
  </code></pre>