Questions tagged [smtplib]

`smtplib` is a Python module that defines an SMTP client session object. It can be used to send mail to any Internet machine with an SMTP or ESMTP listener daemon.

smtplib is a Python module that defines an SMTP client session object. It can be used to send mail to any Internet machine with an SMTP or ESMTP listener daemon. For details of SMTP and ESMTP operation, consult RFC 821 (Simple Mail Transfer Protocol) and RFC 1869 (SMTP Service Extensions).

Reference: http://docs.python.org/library/smtplib.html

1300 questions
0
votes
1 answer

Strange error in python using SMTPLIB module

still having issues. I just added some code which uses the smtplib module to send an email to the email address that has been entered by the user, however I got this error File "C:\Python27\lib\smtplib.py", line 555, in login raise…
0
votes
2 answers

Strange error while trying to attach email attachment in python

I am trying to send an email using python. I am getting a strange error while I am trying to attach attachment to it. I get an error when I try to pass an array value to attachment.add_header() function, but when I assign that value to a variable…
0
votes
1 answer

Empty message send with smtplib

I don't understand why i send empty message with my code. No message, No subject. I've read plenty of sample but i have always the same problem. I did not even understand why sometimes we have to use .close() or .quit() Finally I'm lost, i need…
OlZ
  • 346
  • 1
  • 3
  • 11
0
votes
1 answer

How does a Mail Client (like thunderbird) work?

I am thinking of creating a mail client as a side project and wanted a brief overview of how they work. A few issues I was thinking of are: How do they connect to SMTP servers (My guess is by using built in libraries)? Where are mails stored? How…
Peeyush
  • 6,144
  • 5
  • 23
  • 37
0
votes
1 answer

Segmentation fault when importing smtplib after psycopg2

Recently, I have started getting a segmentation fault when importing both smtplib and psycopg2 using python 2.6.6 on Centos 6 . It only occurs if psycopg2 is imported before smtplib. For example, this works fine: import smtplib import…
Rhino
  • 101
  • 8
0
votes
2 answers

exceptions.AttributeError : SMTP instance has no attribute 'login' :

Hey I have a windows server running python CGI scripts and I'm having a little trouble with smtplib. The server is running python 2.1 (unfortunately and I can not upgrade it). Anyway I have the following code: session =…
Jiaaro
  • 74,485
  • 42
  • 169
  • 190
0
votes
1 answer

smtplib error: Name or Service unknown

I'm trying to use the following script to send an email behind a proxy server. import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText import sys import urllib2 fromaddr = "abc@gmail.com" toaddr =…
m_amber
  • 747
  • 3
  • 13
  • 23
0
votes
1 answer

Python : How to email attached Unix file in DOS format

On a Unix server, I am using smtplib in python to send an email to myself ; the email also contains a unix file attachment. I use outlook client to view the email and when I open the file, it does not display correctly due to differences in Unix and…
user1074593
  • 446
  • 1
  • 9
  • 23
0
votes
2 answers

Python smtplib: only the first email out of several arrives to destination

I have put together a function send_email [1] to send emails with support for plain-text and html messages. It works well, but I have an issue I don't quite know how to debug. My system has sendmail as its MTA. The function is called in a for loop,…
Luis E.
  • 841
  • 11
  • 15
0
votes
1 answer

Python email - can only sendmail to one address

My SendMail function looks like this: MY_SMTP = #I can't show it here def SendMail(authentication_data, email_from, email_to_list, email_cc_list, email_subject, email_message, list_file) user_name = authentication_data["name"] user_password…
ulak blade
  • 2,515
  • 5
  • 37
  • 81
0
votes
1 answer

HTML formatting issues with python smtplib and Outlook 2010

I am generating html files using elementtree.ElementTree.dump on an Element. The files look ok in all browsers, and the underlying code within the files looks fine (no unclosed brackets or anything). When I send an email to Outlook 2010 via smtplib,…
BSAFH
  • 725
  • 3
  • 6
  • 19
0
votes
1 answer

python send mail with zip attachment fails on Windows

I'm writing some code that writes a zip file to the file system, and then sends that zip file as an attachment in an email. Code used to create the message and attach the file is: msg = MIMEMultipart() .. with open( filepath, 'r') as fin: data =…
Trent
  • 2,328
  • 3
  • 33
  • 51
0
votes
2 answers

Printing multiple html tables in email from python

Is it possible to put more than one html table into a message sent with smtplib and email? Whenever I use attach() for more than one thing, it only adds the first. Specifically, doing this: msg1 = MIMEMultipart('alternative') msg1['Subject]' =…
PointXIV
  • 1,258
  • 2
  • 15
  • 23
0
votes
0 answers

Problems with smtplib crashing at night

I wrote a simple python script to text people cat facts once an hour. It works fine throughout the day, but it keeps crashing with connection refused errors through out the night. It's only like 10-20 people, so I don't think I'm getting blocked for…
0
votes
2 answers

smtplib doesn't fail on invalid email addresses

In django, I tried sending a mail using send_mail like : from django.core.mail import send_mail send_mail("test", "test", settings.EMAIL_HOST_USER, ["sasdadome@asdijandasd.com"]) This surprisingly sends me a status of 1, which means it was…
Deepankar Bajpeyi
  • 5,661
  • 11
  • 44
  • 64