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

How can I send email to multi addresses by smtplib?

I use bellow code I can send email to one account, but how can I send to multi account? import smtplib from email.mime.text import MIMEText _user = "67676767@qq.com" # _pwd = "orjxywulscbxsdwbaii" # _to = linux213@126.com" # msg =…
qg_java_17137
  • 3,310
  • 10
  • 41
  • 84
0
votes
1 answer

Failed Gmail authentication through smtplib and AWS Lambda

I'm trying to write an AWS Lambda function that periodically sends an email using Python's smtplib. This function works outside of AWS lambda, and I've verified that the environment variables are valid many times. import os import smtplib def…
Kurt Maurer
  • 425
  • 1
  • 5
  • 15
0
votes
1 answer

Recepients are in BCC field when sending email

Whenever I run my code the recipients are in the bcc field rather than the To field (When I check my gmail inbox) I have no idea what can be the reason. How can I stop the recipients being in the BCC field. and make them appear in the TO field Here…
0
votes
1 answer

Several threads connecting to a Postfix server?

I'm writing a program which is sending files through SMTP, thanks to my (local) Postfix server, on port 25. Is it possible to use several threads (thus several sockets) to inject emails faster ?
Adrien
  • 1
0
votes
0 answers

Is using python script to send email (from mydomain.com) different from using webmail?

I have a personal domain name (let's call it domain.com) that uses publicly signed a certificate to send and receive emails. I use iRedMail webmail, and I can send emails to almost any other domain names including gmail.com and ymail.com with no…
mazkopolo
  • 391
  • 1
  • 6
  • 21
0
votes
0 answers

Error in sending email from a Amazon Lambda function using python SMTP library

I am trying to send an email from an Amazon Lambda function using python's SMTP library. Here is my code so far: import smtplib from_addr = 'fromemailid@company.com' username = 'user1' password = 'pwd' def send_email(): to_addrs =…
user2966197
  • 2,793
  • 10
  • 45
  • 77
0
votes
1 answer

Clicking email content should call a python fucntion?

I am working on an assignment in which I have to the send an email to the customer and if he clicks the accept link in the email, call the python function that completes the desired functionality and adds it to the database. My question is how can…
0
votes
1 answer

Outlook stops working after running python email sending script?

I wrote a script to send an email using python. The script worked and the recipient received an email. However, I kept myself in CC and I didn't get an email and moreover, my outlook stopped working after that. import smtplib from…
0
votes
2 answers

How to combine two string variables into one multiline variable?

I want to use python to send an email with two rows(lines) of text like this a b c d e f g h I tried to use xxx.attach() but I found that the second row is replaced the first one. part1 = MIMEText(text1, 'plain') part2 =…
NaC
  • 13
  • 5
0
votes
0 answers

Smtplib fails sending email from mail.ru

I use smtplib to send emails using this code: file = "path_to_a_file" part = MIMEBase('application', "octet-stream") part.set_payload(open(file, "rb").read()) encoders.encode_base64(part) part.add_header('Content-Disposition', 'attachment;…
0
votes
1 answer

Multi-recipient script mail python did'nt work

I have managed to run a python script that will allow me to send mails automatically with an attachment using the cron command; only I would like to use it to send this same mail to several recipients at the same time. This will save me a lot of…
Barbosa
  • 19
  • 5
0
votes
1 answer

How to include the logging event level SMTPHandler subject line?

The SMTPHandler requires a "subject" to be included when it is initialized. How can the subject line include the level of the event that generated the email? For example: import logging from logging.handlers import SMTPHandler logger =…
Greg
  • 8,175
  • 16
  • 72
  • 125
0
votes
1 answer

Error when trying to send an email using python smtplib

import smtplib host = 'smtp.gmail.com' port = 587 username = 'rajinirajadev@gmail.com' password = '*************' from_email = username to_list = ['rajiniraja00@gmail.com'] email_conn =…
rajini raja
  • 99
  • 3
  • 13
0
votes
1 answer

Send mails with Python and an IMAP/SMTP Server

i have a couple issues with sending Email with Python using my own SMTP/IMAP Server. Here's the code : import sys import imaplib import smtplib import email import email.header import datetime smtp_session = smtplib.SMTP(mail_server) try: …
Aurelien
  • 688
  • 1
  • 9
  • 22
0
votes
2 answers

Python Email Sender App gives random weird spacing between words in HTML Template

Sorry for the poor title, I'm currently experiencing a weird problem with my code. When I send an email using my app, some words has weird spacing in between them. For example: "Feel free to use our stor age for xx days" The spacing usually happens…
Dominic
  • 928
  • 3
  • 9
  • 19