Navigation

    Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    Bulk Email AWS SES

    General Discussion
    aws
    3
    8
    321
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      foxmolder last edited by

      aws ses වල එක පාර ඊමේල් ලිස්ට් එකකට ඊමේල් යවන්න ක්‍රමයක් තියෙනවද .?

      root 1 Reply Last reply Reply Quote 0
      • root
        root Linux Help @foxmolder last edited by

        @foxmolder

        ehema nam na bulk email yawanna puluwan software ekak use karanna wenawa, aws ses kiyanne email service ekak

        1 Reply Last reply Reply Quote 0
        • F
          foxmolder last edited by

          Simple python script ekakin bulk yawanna puluwan..

          1 Reply Last reply Reply Quote 0
          • X
            Xenon Linux Help last edited by

            @foxmolder otp requests yawalada?

            F 1 Reply Last reply Reply Quote 0
            • F
              foxmolder @Xenon last edited by

              @xenon eyala dela thiyena sample code ekakata for loop ekak ekak and array ekak use karala

              root 1 Reply Last reply Reply Quote 0
              • root
                root Linux Help @foxmolder last edited by root

                @foxmolder

                email limit ekak thiyenawa ses wala, oka yawanne one queue ekak widiyata

                F 1 Reply Last reply Reply Quote 0
                • F
                  foxmolder @root last edited by

                  @root eyala time eka manage karanawa. eth bounce rate eka handle karaganna eka thamai amaru.. mage code eka danna puluwan methana kawru hari innawa nam bounce rate eka manage karana script eka ekata ekathu karala improve karanna

                  1 Reply Last reply Reply Quote 0
                  • F
                    foxmolder last edited by

                    import smtplib
                    import email.utils
                    from email.mime.multipart import MIMEMultipart
                    from email.mime.text import MIMEText

                    fruits = ["[email protected]","[email protected]", ]
                    for RECIPIENT in fruits:

                    Replace [email protected] with your "From" address.

                    This address must be verified.

                    SENDER = '[email protected]'
                    SENDERNAME = 'ex.com'
                    

                    Replace [email protected] with a "To" address. If your account

                    is still in the sandbox, this address must be verified.

                    RECIPIENT = '[email protected]'

                    Replace smtp_username with your Amazon SES SMTP user name.

                    USERNAME_SMTP = ""
                    

                    Replace smtp_password with your Amazon SES SMTP password.

                    PASSWORD_SMTP = ""
                    

                    (Optional) the name of a configuration set to use for this message.

                    If you comment out this line, you also need to remove or comment out

                    the "X-SES-CONFIGURATION-SET:" header below.

                    CONFIGURATION_SET = "ConfigSet"

                    If you're using Amazon SES in an AWS Region other than US West (Oregon),

                    replace email-smtp.us-west-2.amazonaws.com with the Amazon SES SMTP

                    endpoint in the appropriate region.

                    HOST = "email-smtp.us-east-2.amazonaws.com"
                    PORT = 587
                    

                    The subject line of the email.

                    SUBJECT = ' '
                    

                    The email body for recipients with non-HTML email clients.

                    BODY_TEXT = (""
                             ""
                             ""
                            )
                    

                    The HTML body of the email.

                    BODY_HTML = """<html>
                    
                    </html>
                    
                    
                            """
                    

                    Create message container - the correct MIME type is multipart/alternative.

                    msg = MIMEMultipart('alternative')
                    msg['Subject'] = SUBJECT
                    msg['From'] = email.utils.formataddr((SENDERNAME, SENDER))
                    msg['To'] = RECIPIENT
                    

                    Comment or delete the next line if you are not using a configuration set

                    msg.add_header('X-SES-CONFIGURATION-SET',CONFIGURATION_SET)

                    Record the MIME types of both parts - text/plain and text/html.

                    part1 = MIMEText(BODY_TEXT, 'plain')
                    part2 = MIMEText(BODY_HTML, 'html')
                    

                    Attach parts into message container.

                    According to RFC 2046, the last part of a multipart message, in this case

                    the HTML message, is best and preferred.

                    msg.attach(part1)
                    msg.attach(part2)
                    

                    Try to send the message.

                    try:
                        server = smtplib.SMTP(HOST, PORT)
                        server.ehlo()
                        server.starttls()
                    #stmplib docs recommend calling ehlo() before & after starttls()
                        server.login(USERNAME_SMTP, PASSWORD_SMTP)
                        server.ehlo()
                        server.sendmail(SENDER, RECIPIENT, msg.as_string())
                        server.close()
                    

                    Display an error message if something goes wrong.

                    except Exception as e:
                        print ("Error: ", e)
                    else:
                        print ("Email sent!")
                    
                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    0
                    Online

                    1.9k
                    Users

                    952
                    Topics

                    4.8k
                    Posts

                    • Privacy
                    • Terms & Conditions
                    • Donate
                    • Contact Us

                    © Copyrights and All right reserved Lanka Developers Community

                    Sponsored by Axis Technologies (PVT) Ltd

                    Made with in Sri Lanka

                    | |