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
0 answers

python smtplib does not have permissions to send as this sender

Hi I am trying to send out an email through smtplib, I want to keep the username different from the login username. It is giving me an error when I used a shared mailbox which I do have the permission to send and revive emails and port number and…
0
votes
1 answer

SMTPServer with asyncore leave sockets open?

I have implemented a basic SMTPServer which works great but I'm encountering an issue and I don't know how I can fix it. When checking the file descriptors opened for the $PID of the process running my script (ls -l /proc/$PID/fd/ | grep "socket:" |…
Cyril N.
  • 38,875
  • 36
  • 142
  • 243
0
votes
0 answers

Issue with smtplib Python 3.6

I made a program to send email with attachment. While the program is loading the files to be attached, the gui stops responding and Windows changes the window status to 'not responding', but when it has finished loading the files everything is back…
Luca
  • 160
  • 3
  • 14
0
votes
3 answers

Python SMTPLIB does not connect

Hi I am trying to connect to the outlook server to sending the email with smtplib in python. Trying this code smtplib.SMTP('smtp-mail.outlook.com') does not print out anything and also does not return an error. Can somebody tell me what might be…
0
votes
0 answers

How to send email via python to several recipients with contacts on text file

When I write the script below I get the error IndexError: list index out of range: import smtplib from string import Template from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText MY_ADDRESS =…
pepperjohn
  • 67
  • 1
  • 3
  • 11
0
votes
1 answer

Sending file attachments using SMTPLIB.data()

I'm trying to send an email using smtplib using the low-level commands such as MAIL, RCPT and DATA. This allows me to disguise the To field while still delivering to the proper inbox (required). My issue is that I have not found a way to send file…
Kyle
  • 355
  • 1
  • 4
  • 13
0
votes
0 answers

Delayed emails and abnormal email headers

I have been using smtplib for Python and task schedulers to send emails using one of my gmail accounts. Sometimes, like twice in the past 2 weeks, my email delivery gets delayed. I thought it might be a network issue the first time, but it happened…
Adeel Siddiqui
  • 676
  • 7
  • 16
0
votes
2 answers

Smtplib: Connection unexpectedly closed

I am using following code: def mailme(): print('connecting') server = smtplib.SMTP('mail.server.com', 26) server.connect("mail.server.com", 465) print('connected..') server.ehlo() server.starttls() server.ehlo() …
Volatil3
  • 14,253
  • 38
  • 134
  • 263
0
votes
1 answer

Passing address of non-local object to _autoreleasing parameter for write-back in SKPSMTPMessage.m using Objective C?

I am new to iOS,I have Implemented Background mail using SMTP Server,While Integrating with Main Project I am getting (passing address of non-local object to _autoreleasing parameter for write-back) this error I don't know how to solve that ,I…
Shubam Gupta
  • 61
  • 1
  • 11
0
votes
1 answer

Python smtplib connect error 10060

I have an error I do not understand using smtplib. I'm on windows 10, and in the cmd window I have set : set MAIL_SERVER=smtp.googlemail.com set MAIL_PORT=587 set MAIL_USE_TLS=1 set MAIL_USERNAME='my-gmail-username' set…
Tom
  • 91
  • 7
0
votes
1 answer

Python 2.7 Test if SMPT Mail was sent

I'm trying to do an fully automated Raspberry Pi using the SMTP Library to send an E-Mail with an attachment to a specific Address. But I don't actually know how to test if the E-Mail was sent successfully. And if it could not be sent for some…
Gameniti
  • 1
  • 2
0
votes
1 answer

send_mail works locally but not on production hosting

The following works locally but as I deployed it to production hosting at Digital Ocean, the email is not sending as I test on shell command (python manage.py shell) like below. The send_mail line just got stuck there and am getting error: [Errno…
djreenykev
  • 143
  • 2
  • 14
0
votes
1 answer

How can I add changing content to an automated mail (smtplib) in python 3.6.2?

I want to send a mail to myself. How can I change the content to a varying text rather than a static text? import smtplib import random from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText #food dictionary food =…
Kiwipo17
  • 23
  • 4
0
votes
0 answers

Attaching a google drive file in mail using code (preferably Python)

I need to attach the same file in multiple emails using code (currently I am using python). Iterating over this process for each mail ends up uploading the same file multiple times which further leads to exceeding the gmail's daily upload limits . …
J.Doe
  • 1
0
votes
1 answer

Python smtplib ''Subject'' why doesn't it print any subject. I've tried almost anything now

The email sending code works fine without problems, but it prints all of it in the message field. I've basically tried everything the last 3 hours. Any advice guys? import smtplib fromaddr="xxxxx@xxx.com" toaddr="xxxxx@xxxx.com" message =…
Daniel Saggo
  • 108
  • 1
  • 9