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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:20:28+00:00 2026-05-22T01:20:28+00:00

I want to write a program that sends an e-mail to one or more

  • 0

I want to write a program that sends an e-mail to one or more specified recipients when a certain event occurs. For this I need the user to write the parameters for the mail server into a config. Possible values are for example: serveradress, ports, ssl(true/false) and a list of desired recipients.

Whats the user-friendliest/best-practice way to do this?

I could of course use a python file with the correct parameters and the user has to fill it out, but I wouldn’t consider this user friendly. I also read about the ‘config’ module in python, but it seems to me that it’s made for creating config files on its own, and not to have users fill the files out themselves.

  • 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-22T01:20:28+00:00Added an answer on May 22, 2026 at 1:20 am

    Are you saying that the fact that the config file would need to be valid Python makes it unfriendly? It seems like having lines in a file like:

     server = 'mail.domain.com'
     port = 25
    

    …etc would be intuitive enough while still being valid Python. If you don’t want the user to have to know that they have to quote strings, though, you might go the YAML route. I use YAML pretty much exclusively for config files and find it very intuitive, and it would also be intuitive for an end user I think (though it requires a third-party module – PyYAML):

     server: mail.domain.com
     port: 25
    

    Having pyyaml load it is simple:

    >>> import yaml
    >>> yaml.load("""a: 1
    ... b: foo
    ... """)
    {'a': 1, 'b': 'foo'}
    

    With a file it’s easy too.

    >>> with open('myconfig.yaml', 'r') as cfile:
    ...    config = yaml.load(cfile)
    ... 
    

    config now contains all of the parameters.

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

Sidebar

Related Questions

I want to write a program that sends email using Python's smtplib . I
I want to write a program that shows one PC's screen to the others...
I want to write a program that sends GPS location (lattitude, longitude) at a
I want to write a program that would print every combination of a set
I want to write a small program that should print something like testing CPU...
I want to write a program in C/C++ that will dynamically read a web
I want to write a program in which plays an audio file that reads
I am trying to write an SSL client that sends mail using the javax.mail
I want to write a program that will generate random notes and draw them
I want to write a C++ program that plays MP3. Among available MP3 decoding

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.