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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:00:59+00:00 2026-06-17T09:00:59+00:00

I copied and pasted this example and filled in my own email addresses. #

  • 0

I copied and pasted this example and filled in my own email addresses.

# Import smtplib for the actual sending function
import smtplib

# Import the email modules we'll need
from email.mime.text import MIMEText

# Open a plain text file for reading.  For this example, assume that
# the text file contains only ASCII characters.
fp = open('/Users/Jon/dev/iit/test-tools/logs/practice_tests.test_one.log', 'rb')
# Create a text/plain message
msg = MIMEText(fp.read())
fp.close()

me = 'Jon@MacBookPro.com'
you = 'jon.drowell@yahoo.com'

# me == the sender's email address
# you == the recipient's email address
msg['Subject'] = 'The contents of the log file'
msg['From'] = me
msg['To'] = you

# Send the message via our own SMTP server, but don't include the
# envelope header.
s = smtplib.SMTP('localhost', 1025)
s.sendmail(me, [you], msg.as_string())
s.quit()

I then opened another terminal window and ran the following command:

python -m smtpd -n -c DebuggingServer localhost:1025

When I run the file to send email, it finishes without error, and the terminal that is running the python -m smtpd -n -c DebuggingServer localhost:1025 command prints a nice log message that looks correct:

---------- MESSAGE FOLLOWS ----------
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: The contents of the log file
From: Jon@MacBookPro.com
To: jon.crowell@yahoo.com
X-Peer: 127.0.0.1

line one
line two
line three
------------ END MESSAGE ------------

But when I check my yahoo email address, the email never arrives. I have waited about 5 minutes, which I think is adequate. What did I do wrong?

  • 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-06-17T09:01:00+00:00Added an answer on June 17, 2026 at 9:01 am

    From the smtpd documentation

    class smtpd.DebuggingServer(localaddr, remoteaddr)
    Create a new debugging server. Arguments are as per SMTPServer. Messages will be discarded, and printed on stdout.

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

Sidebar

Related Questions

I've copied and pasted the example ejb-jar.xml and jboss.xml file from http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch6.chapt.html#ch6.mdbejbjar.ex and I'm
I copied and pasted the example YouTube api code for browser-based uploading to my
The complete code is copied and pasted below. I am new to javascript and
I'm working on some doc file, that when copied and pasted into a text
The copied original folder should be pasted inside folder named with today's date like
I copied this class from a similar class I have in this app that
i have copied and pasted an script from php.net website... Using an online free
So I have code like this: $(.list).append('<li>hi</li>'); Here's a working example: http://jsfiddle.net/pXaSC When you
I have PDF papers copied/pasted into TXT as input and I want to build
Was looking at the reference page here : http://www.w3.org/TR/html5/offline.html I copied and pasted the

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.