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

TypeError: 'NoneType' object is not iterable :smtplib

def sendmail(self, from_addr, to_addrs, msg='hello', mail_options=[],rcpt_options=[]): self.ehlo_or_helo_if_needed() esmtp_opts = [] if self.does_esmtp: # Hmmm? what's this? -ddm …
0
votes
1 answer

How do I change the from line on a mail sent using smtplib?

Possible Duplicate: Specify a sender when sending mail with Python (smtplib) I'm using smtplib to send a mail in python. When I view a sent mail, the from line only says "contact" because I have FROM = "contact@foo.com". However, I'd like the…
sharataka
  • 5,014
  • 20
  • 65
  • 125
0
votes
2 answers

Unable to send an email using python

Currently we have a server (Windows 2003 sp2) that runs python scripts overnight, and then emails us whether the scripts ran correctly, I am transferring these scripts to a new server (also Windows 2003 SP2), however when the script tries to use the…
MapMan
  • 630
  • 2
  • 13
  • 28
0
votes
1 answer

Attribute error in a simple xmlrpc python script

I have a simple xmlrpc server setup to start a SMTP server, the code is here: from SimpleXMLRPCServer import SimpleXMLRPCServer import smtplib # Create server server = SimpleXMLRPCServer(("localhost", 1025), allow_none = True) # add the…
Alex
  • 41,580
  • 88
  • 260
  • 469
0
votes
1 answer

pyinotify code cleanup smtplib

New Coder here I'm hoping to be able to clean this code up a bit. I want to be able to move the smtplib stuff out of the class but I still need it to send an email with the pinotify data If you look at my code you'll see. It is very redundant. if…
elzwhere
  • 869
  • 1
  • 6
  • 13
0
votes
1 answer

which port to open for gmail TLS in python smtplib

I tried to do the following: import smtplib smtplib.SMTP("smtp.gmail.com",587) I got the error: socket.error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established…
Boaz
  • 4,864
  • 12
  • 50
  • 90
0
votes
1 answer

What exactly is a python sub message object if is_multipart is true and how does python organize them?

I am using the email module and creating a message object out of both ASCII and Unicode files that are essentially emails. The emails include a secretary responding in one portion and in others the boss creating the email. These emails were…
Nightvein
  • 60
  • 8
-1
votes
2 answers

Formatting text in a sent message in smtplib

To send an email, I use a certain function: def send_email(self, subject, to_addr, from_addr, content): body_text = '' for cnt in content: body_text += str(cnt) BODY = '\r\n'.join(( 'From: %s' % from_addr, 'To:…
Alex Rebell
  • 465
  • 3
  • 15
-1
votes
1 answer

Python SMTP not working even with "correct" settings (logs in doesnt send)

I'm trying to send an OTP via email (which I save in a DB as well) and even though I believe my config is right because it logs in, it doesn't send messages (it did the first 2 times and then stopped): message = """Subject: Your OTP Hi, your…
-1
votes
1 answer

How to prevent python for giving away file path when sending email?

Here is my python code for sending email. I always use an absolute path for attachment when email was sent its always give away for dir structure for example attachment will be named home/user/mail/filename.xls. here is what I did using os.chdir…
-1
votes
1 answer

When im sending email with multiple attachments via smtplib in django. Only the last one can be opened

Im creating django app which sends uploaded files to other users of the app. But only the last file which is attached to the email is readable, rest is corrupted and I don't know why. Here is the code which I'm using to create email and add the…
-1
votes
1 answer

Can't send text email to multiple people, just goes to the first person?

I was having issue's posting on this site so posted on Reddit. https://www.reddit.com/r/learnpython/comments/117uumz/cant_send_text_email_to_multiple_people_just_goes/ However, no one there seems to be able to help. Kind Regards.
vee2gee
  • 5
  • 2
-1
votes
2 answers

Sending a csv file as email attachment using python

I wanna send a csv file as an email attachment. However, when I try to send the mail with an attachment I receieve 'list' object has no attribute 'encode' error. This is the code I'm using. If i remove the attachment I'm able to send the mail. def…
tjarne
  • 21
  • 4
-1
votes
1 answer

Python mail sending error: "CERTIFICATE VERIFY FAILED" & "WRONG VERSION NUMBER"

Through the smtp email server, I'm attempting to send an email. I tried using the SMTP SSL() and starttls() methods to send emails, but both returned errors: WRONG VERSION NUMBER for SMTP SSL() and CERTIFICATE VERIFY FAILED for starttls(). Below are…
-1
votes
1 answer

Python variable not updating

Basically I'm creating a program to help with my work. It will send emails to people in an excel list and move down to the next first name and email address in the list until it's done. Heres the code so far `#AutoMail Version 2 #Goal of new version…
gcb140
  • 19
  • 2