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
-1
votes
1 answer

Adding multiple e-mail addresses to config.json

I'm working on someone else's script and need to update the config.json file to contain multiple e-mail addresses. The e-mail module uses smtplib and the 'to_address' is contained in config.json. It works fine with the only a single address, but I'm…
kill9all
  • 101
  • 1
  • 8
-1
votes
1 answer

Sending email where address contains special characters using Python sendmail

I have an email address like my-email@domain.com Im getting an error: TypeError: unhashable type: 'list' This is the gist of the code I am using: subject = "Email" msg['From'] = 'me@company.com' recipients =…
thentangler
  • 1,048
  • 2
  • 12
  • 38
-1
votes
2 answers

Gmail sending problems

So i try smtplib to send gmail automatically, however it fail because of a error, after some checking, my username and pass are True. So i want to ask if there were any mistakes that can lead to this error. Here is my code, the port is 465 and i…
-1
votes
1 answer

How do you prevent smtplib library from sending no subject?

for i in range(3): gmail_user = 'email' gmail_password = 'pass' sent_from = gmail_user to = ['email'] subject = 'Lorem ipsum dolor sit amet' body = rand_quote email_text = ("""\ From: %s To: %s …
-1
votes
1 answer

How to schedule an email using python? Without scheduling the code

As you know, Gmail has a feature for sending emails on a specific date. Although I have found many tutorials about sending emails directly, it seems there is no idea for using the Gmail scheduling feature in python. How we should do it? I should…
-1
votes
1 answer

sending emails on a loop using Python

I am trying to use a for-loop to send an email to multiple recipients, if "<>" is found in the subject or body, it is replaced dynamically with the recipients name. I am looping over a dictionary of recipients in the form {"name": "email"} from…
Tomas
  • 1
  • 2
-1
votes
1 answer

what is the max limit for sending mails on google mail with bots/ per day?

actually, i am trying to send about 400 mails with python smtplib and rendering html in the mail, but after the 98th mail, connection was closed. I know that the time limit for sending google mails per day is 500, so why my connection is closed.…
Twfyq Bhyry
  • 150
  • 1
  • 10
-1
votes
1 answer

Python how to remove header when sending an email?

I am trying to remove the header section, currently the received email looks like this: . I don't want it to be displayed when the receiver gets the email, I am not sure how to hide it. I tried to just delete it but received an error. That code is…
Sahil
  • 3
  • 1
-1
votes
1 answer

Issues with smtplib sending mails

I tried following a youtube video on how to use smtplib to send emails, however whenever I try to send anything it gives me this error. in alert_mail msg.set_content(body) File…
Elloder
  • 29
  • 5
-1
votes
1 answer

Email sending before file is saved

I'm trying to make a program that captures everything I type on my keyboard, saves it to a text file and emails it to me. Every time it emails it it is empty or has text from the last time I ran it. I'm not sure what to do. from pynput.keyboard…
-1
votes
1 answer

Python SMTP connection is too slow in API call

I have a small issue with the smtplib in Python. I am currently building an API with Flask and I am going through the authentication stage. The theory is very simple: I have created a route accepting POST requests via json with username, password…
BeGeos
  • 29
  • 8
-1
votes
3 answers

Change email credentials when looping smtp python

I am working with the below code to send emails to customer and as you guys know there is daily sending limits set by different companies. What I want to achieve is to change email credentials before reaching limit but continue with the recipient…
srinath
  • 1
  • 1
-1
votes
2 answers

SMTP on AWS private subnet EC2, Network unreachable [errorno 101]

Trying to send emails using SMTPlib in python script on private subnet EC2 machine using following code. EC2 machine has communication with internal SMTP server through PORT 25 , verified using telnet command. This code works fine from public subnet…
-1
votes
1 answer

How to format an email which contains form data using HTML?

I'm trying to format an email using HTML, which gets sent to me whenever someone fills up a form along with the form data e.g. {{ name }}. Currently, I managed to pass the form data via email using an "f" string. I don't know how to make field…
-1
votes
1 answer

Smtplib not working with Env Variables and gets AttributeError: 'NoneType' object has no attribute 'encode'

I've tried using smtplib to send emails using python, but when I hide my username and password with python-dotenv, the email sending doesn't work and I get the error: Traceback (most recent call last): File "test.py", line 43, in
LukeWu
  • 13
  • 2