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

Smtplib doesn't Work

I got the script from the first example here: https://docs.python.org/2/library/email-examples.html#email-examples I made sure there is no file name similar to email.py. import smtplib # Import the email modules we'll need from email.mime.text…
donald
  • 1
  • 1
0
votes
1 answer

Python SMTPLib can no longer authenticate but django can still send emails on the same machine

We run an overnight script to send emails to a bunch of people at our company. A few days ago, the connection was held open for a long period of time and eventually timed out, and since then we have been unable to use the same code on the same…
Hawk
  • 271
  • 1
  • 7
0
votes
1 answer

Collect Python output till current execution and assign it to variable for sending email

I am doing text processing using Python in which I am looking for a specific text in a console log and printing every matched line. This is accomplished by a function called: get_matched_log_lines(url, search_pattern, print_pattern) where url = from…
Pratik Jaiswal
  • 309
  • 7
  • 26
0
votes
2 answers

Python char encoding

I have the following code : msgtxt = "é" msg = MIMEText(msgtxt) msg.set_charset('ISO-8859-1') msg['Subject'] = "subject" msg['From'] = "from@mail.com" msg['To'] = "to@mail.com" serv.sendmail("from@mail.com","to@mail.com", msg.as_string()) The…
OldJim
  • 331
  • 1
  • 2
  • 12
0
votes
2 answers

SMTP Sending e-mail issue with Gmail

I have a script that sends a .png file with SMTP. When I use a hotmail account; smtplib.SMTP('smtp.live.com', 587) It works without any problem. But when I use a gmail account; smtplib.SMTP('smtp.gmail.com', 587) An error raises:…
GLHF
  • 3,835
  • 10
  • 38
  • 83
0
votes
1 answer

Getting number of characters through it's memory size in python

[ Python ] I have a string and I know it's size in memory. I want to get the number of characters (a rough estimate) will it contain. Actual case, I want to send a report through mail, the content of the mail is exceeding the permitted size is…
Program Questions
  • 440
  • 2
  • 6
  • 20
0
votes
1 answer

Django SMTP error 530

Hi I am trying to send test email from my contact page using Django project. I have set up my settings.py in a following way: ALLOWED_HOSTS =…
Paul85
  • 647
  • 1
  • 11
  • 27
0
votes
1 answer

What is the right way to use variables in multiline strings with smtplib in Python?

I just posted this question a few hours ago: Is there any way to use variables in multiline string in Python? Right now I'm using the following code suggested in a comment: from string import Template import textwrap ... try: subject_mail = { …
user5835566
0
votes
2 answers

python check user input for email password loop

I would like to have my script verify that an email password is correct before proceeding with the rest of the script. I'm sure it's just a simple loop, but I can't think of an easy way to do it. Right now my script is: import arcpy, os, sys, time,…
morgan
  • 63
  • 1
  • 8
0
votes
1 answer

access file's actual code as string Python

this is mainly curiosity, I'd like to access my script's actual code, so for a file: #!/usr/bin/env python # coding: utf-8 import os, sys, subprocess, time, re import yagmail it would return code = """\ #!/usr/bin/env python # coding:…
codyc4321
  • 9,014
  • 22
  • 92
  • 165
0
votes
1 answer

HTML/RICH emails dynamically sent from Python

I have what I thought was a simple task to do, that has now snow balled into something else. I wrote a simple python script that would generate simple customer notification over email in plain text using smtplib pretty simple. Now when trying to…
sqwale
  • 554
  • 3
  • 24
0
votes
1 answer

Collect multiple html files in a single email message

str_htmlHeader = "\n\n"; str_htmlHeader += "\n\tAudi Cloud Services\n\n\n"; str_htmlHeader += "\n\n

Nightly build test results

\n"; str_htmlFooter = "\n\n\n"; for…
sam
  • 203
  • 4
  • 17
0
votes
1 answer

Cannot forward an email with attachments using imap and smtplib

I've read on how to forward an email using imaplib and stmplib. I grab these emails (have attachments) off of gmail, sort them and want to forward them to another email account. My code is here, and looks very…
Slamice
  • 693
  • 1
  • 9
  • 25
0
votes
0 answers

Sending gmail to gmail message using smtplib python

email_user = 'sender@gmail.com' email_pass = 'password' SMTP_URL = "smtp.gmail.com:587" def send_email(price): try: s = smtplib.SMTP(SMTP_URL) s.ehlo() s.starttls() s.ehlo() s.login(email_user,…
elexhobby
  • 2,588
  • 5
  • 24
  • 33
0
votes
1 answer

Sending from gmail with smtplib

I'm attempting to use smtplib to set up a python script that will email out alert notifications. I don't need anything fancy, so I figured I'd stick with the basics and use SMTP for my messages. Following one of the many available online examples,…
Empiromancer
  • 3,778
  • 1
  • 22
  • 53