Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3399740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:48:29+00:00 2026-05-18T04:48:29+00:00

I am trying to pull the cc’ed email addresses from received email. I am

  • 0

I am trying to pull the cc’ed email addresses from received email. I am working in the development server.

The tutorial says that “cc contains a list of the cc recipients.” But it seems that message.cc returns a string. I am just using the code I copied from the cookbook:

class ReceiveEmail(InboundMailHandler):
    def receive(self, message):
        logging.info("Received email from %s" % message.sender)
        plaintext = message.bodies(content_type='text/plain')
        for text in plaintext:
            txtmsg = ""
            txtmsg = text[1].decode()
            logging.info("Body is %s" % txtmsg)
            logging.info("CC email is %s" % message.cc) 

So if I have 1 cc, the log shows:

CC email is cc12@example.com

If there are more than 1:

CC email is cc12@example.com, cc13@example.com

To get the first email “cc12@example.com”, I tried:

logging.info("CC email is %s" % message.cc[0])

but this gives:

CC email is c

so the result is treated as a string.

When I try

logging.info(“CC email is %s” % list(message.cc)

I get

['c', 'c', '1', '2', '@', 'e', 'x', 'a', 'm', 'p', 'l', 'e', '.', 'c', 'o', 'm', ',', ' ', 'c', 'c', '1', '3', '@', 'e', 'x', 'a', 'm', 'p', 'l', 'e', '.', 'c', 'o', 'm', ',', ' ', 'c', 'c', '1', '4', '@', 'e', 'x', 'a', 'm', 'p', 'l', 'e', '.', 'c', 'o', 'm'

Again, it appears that message.cc returns string not list.

Do I need to use regex to get the emails? Any suggestions about what I am doing wrong? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:48:29+00:00Added an answer on May 18, 2026 at 4:48 am

    Try:

    cc_list = message.cc.split(',')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pull in data from a remote SQL Server. I can access
I am trying to pull dynamics from a load that I run using bash.
I am trying to pull the anchor text from a link that is formatted
Trying to pull rows from a table and list them in an ol, however,
I am trying to pull posts from a specific month that has been clicked
I am trying to pull some data from a server (I don't own the
I am trying to pull at list of resource/database names and IDs from a
Trying to pull info from one JSON datafeed and use that to make another
I'm trying to pull first_name from Names table, but only if that users_id is
I am trying to pull 1 week data from sql server, then trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.