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

Difference between smtplib.sendmail() and email.message["To"]?

I have been testing my code to send email to multiple recipients, but i came across a strange observation: message["To"] = 'email_one.sample.com, email_two.sample.com' sendmail(mine_email, ['email_one.sample.com'], message.as_string()) The above…
Kronos
  • 3
  • 4
-1
votes
2 answers

Gathering bug reports?

Premise: I am a beginner in search for an easy way to send bug reports from users over sea. I've made a script for some friends that are living on the other side of the sea (US - EUROPE)... I will like to gather automatic bug reports whenever they…
Virgil Sisoe
  • 195
  • 1
  • 12
-1
votes
1 answer

smtplib.SMTP.sendmail raise exception but its str is (250, 'ok')

try: if not self.check_smtp_connected("main", self.sender_addr): self.close("main", self.sender_addr) if not self.connect("main", self.sender_addr): self.last_error =…
-1
votes
1 answer

Issues setting up SMTP server

I have read numerous articles and done everything recommended to setup a mail server in windows 2008R2 I am simply trying to send messages from my server from certain websites that I host. I queued mail for delivery then got this back.... 4.4.7…
Judson Terrell
  • 4,204
  • 2
  • 29
  • 45
-1
votes
1 answer

Python - send bulk emails

I've been tasked with sending around 250 emails with around 30kb attachments per email. Each attachment is unique to the recipient. My below code works, although I feel it's too slow, it sends an email around every 7 seconds which across 250 emails…
Krishn
  • 813
  • 3
  • 14
  • 28
-1
votes
2 answers

File location with variable attribute

I want to attach the newly created csv file for emailing from inside a program. The filename is generated inside the program and stored as fname (a string). How do I use that to mention the file location? Will this work? def emailing(fname,…
Dr.Viper
  • 411
  • 2
  • 5
  • 17
-1
votes
1 answer

Is this an valid example from python's smtplib?

Is this an valid example from Python's smtplib? How, from this example, would one send email without giving the password? import smtplib def prompt(prompt): return raw_input(prompt).strip() fromaddr = prompt("From: ") toaddrs = prompt("To:…
-1
votes
2 answers

Using a while loop only once

I am working on a simple program to email me the weather in my city each morning. At the moment, it works, but only once. Using a while loop works, but since I have it set to, while time == 0600: send my mail etc Now obviously, that makes it so…
Will
  • 67
  • 7
-1
votes
1 answer

Sending emails using smtplib from a txt file

I read a list of emails in a txt file and sent it from my smtp server. I am using the same email address for From: and To: which is example@email.com So, all emails in txt file are: example@email.com I can receive all the emails from my txt file. My…
-1
votes
2 answers

python smtplib sendmail failing

import smtplib fromaddress = 'me@example.com' toaddress = [fromaddress] message = """ From: %s To: %s Subject: test Hello Goodbye """ % ( fromaddress, toaddress) server = smtplib.SMTP('mydomain.com') server.set_debuglevel(1)…
user1561108
  • 2,666
  • 9
  • 44
  • 69
-1
votes
1 answer

how to set a proxy for python email client

Recently I am studying email-related and have written a simple mail client to send emails. But unfortunately due to the bad network I can not connect to smtp.gmail.com home. It is OK when I use a proxy in the browser, also OK when the script is run…
user2086454
  • 73
  • 1
  • 4
-1
votes
1 answer

Why is email not being received if it appears to be successfully sent?

I cant understand why I'm not receiving email from this function ... as you can see the smtp transcript is successful I switched to using 10minutemail.com to receive email to make sure it wasnt being blocked by a blacklist or something. I also have…
Terrence Brannon
  • 4,760
  • 7
  • 42
  • 61
-2
votes
1 answer

Error: While sending the mail via smtplib in sendmail() function

from asyncio import constants import pandas as pd import smtplib as smt from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from getpass import getpass print("Reading mails from Excel") data =…
Abhi
  • 1
-2
votes
1 answer

How I can send an email with my work email address using python?

I want to send a computer-generated email by my work email address using a python script. All of the tutorials I found were about Gmail account.
Hritik
  • 3
  • 2
-2
votes
4 answers

Python: Use Variable in mulit-line string

i have two variables: subject = 'this is the subject' body = 'this is the content' For sending this per e-mail with smtplib i have my message variable as an multi line string. But the .format() method doesn't work. Has anybody an idea to solve…
user14097378
1 2 3
86
87