Category Archives: Technology and Society

Email Issue

I’m trying to send myself email from my own Linux machine, via SMPT. I’ve written the following Python program:

#!/usr/bin/env python3

# 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.
with open(“test.txt”) as fp:
# Create a text/plain message
msg = MIMEText(fp.read())

# me == the sender’s email address
# you == the recipient’s email address
msg[‘Subject’] = “Test”
msg[‘From’] = “simberg@interglobal.org”
msg[‘To’] = “simberg@interglobal.org”

# Send the message via our own SMTP server.
s = smtplib.SMTP(‘localhost’)
print(“s has been opened”)
s.send_message(msg)
print(“after send_message”)
s.quit()
print(“End script”)

It runs with no errors, prints the statements to the terminal, but no email appears. How do I diagnose this?

[Update a while later]

Thanks for the help in comments. Still haven’t solved it, but the need for the application that I needed it for has gone away. Nonetheless, it would be good in general to know how to email from a Python script.

Bill Nye The Fascist Guy

And NASA isn’t covering itself in glory here, either.

I was in the same room with Nye a couple nights ago, at a reception. I felt like I needed a safe space.

My Global Access Application

You may recall that I signed up for it, instead of TSA Pre-check, because it included expedited customs (though I don’t travel that much internationally), and only costs $15 more. I’ve been provisionally approved after only two or three weeks, but I can’t get an interview until JUNE 27th. So a) I have to make sure I’m in town that day and b) I have to continue to hope for random TSA Pre-check until then.

Sigh.

[Friday update]

Woo hoo!

Someone sent me a Python script to go out and look for appointments opening up. I used it to snag an appointment for Monday.