AutoIt
AutoIt
Amazon SES: Check sender verification status
See more Amazon SES Examples
Check the email identity created in Request sender verification. This read-only SES Query API operation uses ses:GetIdentityVerificationAttributes. It can look up several email addresses or domains in one signed request. Pending means SES is waiting for confirmation. Success means SES verified the identity. An address can also inherit verification from its domain.
GetIdentityVerificationAttributes
Chilkat AutoIt Downloads
Local $bSuccess = False
; Assumes Chilkat is unlocked. See Global Unlock Sample.
$bSuccess = False
; Use the same AWS Region for the identity, endpoint, and Signature Version 4.
Local $sRegion = "us-west-2"
$oHost = ObjCreate("Chilkat.StringBuilder")
$oHost.Append("email.")
$oHost.Append($sRegion)
$oHost.Append(".amazonaws.com")
$oSigner = ObjCreate("Chilkat.AuthAws")
; Supply the credentials from your application's credential provider.
$oSigner.AccessKey = "AWS_ACCESS_KEY_ID"
$oSigner.SecretKey = "AWS_SECRET_ACCESS_KEY"
$oSigner.Region = $sRegion
$oSigner.ServiceName = "ses"
$oConnection = ObjCreate("Chilkat.Socket")
$oConnection.RequireSslCertVerify = True
$bSuccess = $oConnection.Connect($oHost.GetAsString(),443,True,10000)
If ($bSuccess <> True) Then
ConsoleWrite($oConnection.LastErrorText & @CRLF)
Exit
EndIf
$oRest = ObjCreate("Chilkat.Rest")
$bSuccess = $oRest.UseConnection($oConnection,False)
If ($bSuccess <> True) Then
ConsoleWrite($oRest.LastErrorText & @CRLF)
Exit
EndIf
$bSuccess = $oRest.SetAuthAws($oSigner)
If ($bSuccess <> True) Then
ConsoleWrite($oRest.LastErrorText & @CRLF)
Exit
EndIf
; For temporary AWS credentials, supply the session token from the same provider.
Local $sessionToken = ""
If ($sessionToken <> "") Then
$oRest.AddQueryParam("X-Amz-Security-Token",$sessionToken)
EndIf
; This read-only SES Query action accepts up to 100 addresses or domains.
; Pass the original mailbox name. Chilkat encodes the plus sign when signing the query.
$oRest.AddQueryParam("Action","GetIdentityVerificationAttributes")
$oRest.AddQueryParam("Version","2010-12-01")
$oRest.AddQueryParam("Identities.member.1","sender+reports@example.com")
Local $sResponseText = $oRest.FullRequestNoBody("GET","/")
If ($oRest.LastMethodSuccess <> True) Then
ConsoleWrite($oRest.LastErrorText & @CRLF)
Exit
EndIf
If ($oRest.ResponseStatusCode <> 200) Then
ConsoleWrite("SES returned HTTP " & $oRest.ResponseStatusCode & " " & $sResponseText & @CRLF)
Exit
EndIf
$oResult = ObjCreate("Chilkat.Xml")
$bSuccess = $oResult.LoadXml($sResponseText)
If ($bSuccess <> True) Then
ConsoleWrite($oResult.LastErrorText & @CRLF)
Exit
EndIf
; A map entry contains the identity as key and its verification attributes as value.
If ($oResult.NumChildrenAt("GetIdentityVerificationAttributesResult|VerificationAttributes") < 1) Then
ConsoleWrite("No verification entry returned for this address in this Region." & @CRLF)
Exit
EndIf
Local $status = $oResult.GetChildContent("GetIdentityVerificationAttributesResult|VerificationAttributes|entry|value|VerificationStatus")
ConsoleWrite("Verification status: " & $status & @CRLF)
If ($status = "Pending") Then
ConsoleWrite("Open the AWS verification email and follow its link." & @CRLF)
EndIf