set_identity_dkim_enabled ( $identity, $dkim_enabled, $opt )

Enables or disables Easy DKIM signing of email sent from an identity:

  • If Easy DKIM signing is enabled for a domain name identity (e.g., example.com), then Amazon SES will DKIM-sign all email sent by addresses under that domain name (e.g., user@example.com).
  • If Easy DKIM signing is enabled for an email address, then Amazon SES will DKIM-sign all email sent by that email address.

For email addresses (e.g., user@example.com), you can only enable Easy DKIM signing if the corresponding domain (e.g., example.com) has been set up for Easy DKIM using the AWS Console or the VerifyDomainDkim action.

For more information about Easy DKIM signing, go to the Amazon SES Developer Guide.

Access

public

Parameters

Parameter

Type

Required

Description

$identity

string

Required

The identity for which DKIM signing should be enabled or disabled.

$dkim_enabled

boolean

Required

Sets whether DKIM signing is enabled for an identity. Set to true to enable DKIM signing for this identity; false to disable it.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Testing the DKIM signing feature of SES.

// Instantiate the class
$email = new AmazonSES();

$response = $email->get_identity_dkim_attributes('example.com');

var_dump($response->isOK());

$response = $email->verify_domain_dkim('example.com');

var_dump($response->isOK());

$response = $email->set_identity_dkim_enabled('example.com', true);
$message = (string) $response->body->Error->Message;

var_dump($message);
Result:
bool(true)
bool(true)
string(39) "Identity amazonaws.com is not verified."

Source

Method defined in services/ses.class.php | Toggle source view (8 lines) | View on GitHub

public function set_identity_dkim_enabled($identity, $dkim_enabled, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['Identity'] = $identity;
    $opt['DkimEnabled'] = $dkim_enabled;
    
    return $this->authenticate('SetIdentityDkimEnabled', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback