On this page:
ses-endpoint
ses-region
send-email
send-raw-email
verify-email-address
delete-verified-email-address
list-verified-email-addresses
get-send-quota
send-quota
get-send-statistics
send-statistic
ses

5 SES (Email)

 (require aws/ses) package: aws

Please refer to the SES documentation to understand concepts like a verified sending adddress.

parameter

(ses-endpoint)  endpoint?

(ses-endpoint v)  void?
  v : endpoint?
 = (endpoint "email.us-east-1.amazonaws.com" #t)
The endpoint for the service.

parameter

(ses-region)  string?

(ses-region v)  void?
  v : string?
 = "us-east-1"
The endpoint for the service.

procedure

(send-email #:from from    
  #:to to    
  #:subject subject    
  #:body body    
  [#:cc cc    
  #:bcc bcc    
  #:reply-to reply-to    
  #:return-path return-path    
  #:html? html?    
  #:charset charset])  void?
  from : string?
  to : (listof string?)
  subject : string?
  body : string?
  cc : (listof string?) = '()
  bcc : (listof string?) = '()
  reply-to : (listof-string?) = '()
  return-path : string? = from
  html? : boolean? = #f
  charset : string? = "UTF-8"
Send an email. Unless from has been verified (for example using verify-email-address SES will fail.

If SES returns 400 Bad Request with <Code>Throttling</Code><Message>Maximum sending rate exceeded.</Message>, this repeatedly sleeps for a random 1-16 second interval then retries, until it succeeds or SES fails with some other error.

procedure

(send-raw-email mail-from    
  rcpt-to    
  raw-message)  xexpr?
  mail-from : string?
  rcpt-to : string?
  raw-message : string?
Send a raw email. SES requires a Source to be specified. If a Return-Path mail header is supplied in raw-message then that will be used as the Source, otherwise mail-from will be used.

If SES returns 400 Bad Request with <Code>Throttling</Code><Message>Maximum sending rate exceeded.</Message>, this repeatedly sleeps for a random 1-16 second interval then retries, until it succeeds or SES fails with some other error.

procedure

(verify-email-address address)  void?

  address : string?
Verify the email address with SES, so that it can be used to send emails via SES.

procedure

(delete-verified-email-address address)  void?

  address : string?
Unverify the email address.

Return the list of email addresses currently verified with SES.

procedure

(get-send-quota)  send-quota?

struct

(struct send-quota (sent-last-24-hours
    max-24-hour-send
    max-send-rate)
    #:extra-constructor-name make-send-quota)
  sent-last-24-hours : number?
  max-24-hour-send : number?
  max-send-rate : number?
Get the send quota.

procedure

(get-send-statistics)  (listof send-statistic?)

struct

(struct send-statistic (time
    delivery-attempts
    rejects
    bounces
    complaints)
    #:extra-constructor-name make-send-statistic)
  time : string?
  delivery-attempts : number?
  rejects : number?
  bounces : number?
  complaints : number?
Get send statistics. Although SES keeps statistics for only your last 14 days of sending, each statistic is for a 15 minute bucket and the (listof send-statistics) may be quite long. Note that the list is not necessarily sorted in any particular order.

procedure

(ses params)  xexpr?

  params : (listof (list/c symbol? string?))
The low-level procedure used by other procedures to make requests to SES.

If SES adds new actions and this library isn’t updated to support them, you may be able to support them by setting the Action parameter.