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 6220757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:00:49+00:00 2026-05-24T08:00:49+00:00

I try to send mails from python to multiple email-addresses, imported from a .txt

  • 0

I try to send mails from python to multiple email-addresses, imported from a .txt file, I’ve tried differend syntaxes, but nothing would work…

The code:

s.sendmail('sender@mail.com', ['recipient@mail.com', 'recipient2@mail.com', 'recipient3@mail.com'], msg.as_string())

So I tried this to import the recipient-addresses from a .txt file:

urlFile = open("mailList.txt", "r+")
mailList = urlFile.read()
s.sendmail('sender@mail.com', mailList, msg.as_string())

The mainList.txt contains:

['recipient@mail.com', 'recipient2@mail.com', 'recipient3@mail.com']

But it doesn’t work…

I’ve also tried to do:

... [mailList] ... in the code, and '...','...','...' in the .txt file, but also no effect

and

... [mailList] ... in the code, and ...','...','... in the .txt file, but also no effect...

Does anyone knows what to do?

Thanks a lot!

  • 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-24T08:00:50+00:00Added an answer on May 24, 2026 at 8:00 am
    urlFile = open("mailList.txt", "r+")
    mailList = [i.strip() for i in urlFile.readlines()]
    

    and put each recipient on its own line (i.e. separate with a line break).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have downloaded Swift Mailer from their website and try to send simple email
I try to send a request to my server via GET, but qooxdoo sends
I had try to implement the send me log feature into my apps but
I'm attempting to write a Python function to send an email to a list
I have an application that uses SmtpClient to send E-Mail, but the E-Mails are
In my java application I need to send mails to different mail addresses. I
I am sending email from my ASP.net web application. The mails are sending successfully
I get this message when I try to send mail from php with my
I'm using Delphi 2009 and the lastest Indy 10 from svn to send e-mails
Im trying to send a mail from a asp.net script, but im getting this

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.