If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!
  1. Sign up for Amazon Web Services: http://aws.amazon.com

  2. Enable "Simple Email Service": http://aws.amazon.com/ses/

  3. Install Boto in your Web2py "site-packages" folder: https://github.com/boto/boto

  4. Obtain your Amazon AWS-KEY and AWS-SECRET-KEY: https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key

  5. Before you get "production" access to Amazon's mail servers, you have to pre-register every sender and recipient email address you want to use (up to 100). This is OK for development and testing but of course would not work in production. To register an email address, execute the following code, replacing AWS-KEY and AWS-SECRET-KEY with your own keys and myemail@address.com with the email address you want to register:

    from boto.ses.connection import SESConnection def verify_email_address(): conn = SESConnection('<AWS-KEY>', '<AWS-SECRET-KEY>') m = conn.verify_email_address('myemail@address.com')

  6. Now you are ready to send an email:

    from boto.ses.connection import SESConnection
    
    aws_key = '<AWS-KEY>' aws_secret_key = '<AWS-SECRET-KEY>'
    
    def send_ses(params):
        conn = SESConnection(aws_key, aws_secret_key)
        return conn.send_email(source='myemail@address.com', subject='Subject',
            body='Body.', to_addresses='recipient@email.com', cc_addresses=None,
            bcc_addresses=None, format='text', reply_addresses=None, return_path=None)

Related slices

Comments (0)


Hosting graciously provided by:
Python Anywhere