adding to an email a zip file

I have the code below that works perfectly fine when I use it to send a txt file, an image or audio. However, it doesn't work when I try to send zip files, rar files, or any other file that doesn't have its own MIME (which is not related to MIMEText,...
more »

2017-08-10 17:08 (0) Answers

MIME Email not sending Image attachment

I try to run the following code but the email does not seem to send when the script is finished. The script executes fine untill the last line and doesn't send the email with image attachment. No error is displayed in the CMD. Can someone explain to...
more »

2017-06-23 15:06 (0) Answers

Python, extract raw contents from mbox file

In an mbox file I stored some e-mails: they can also use MIME. They must be extracted as they are in the mbox file, without modifications, with a Python3 script. I tried the following code: import mailbox for message in mailbox.mbox('mboxfile'): ...
more »

2017-06-23 11:06 (0) Answers

Subject is not passing when sending email

I am sending an email as follows : def sendEmail(serial_number,date, time, latLon): sender = serial_number+'@sdtr.com' receivers = ['michael.grobman@station711.com'] msg = MIMEMultipart() msg['From'] = sender msg['To'] = receivers msg['Subject'] ...
more »

2017-05-04 20:05 (1) Answers

MIME in python attaching files

import smtplib import os fromaddr = 'myemail@gmail.com' toaddrs = 'targetemail@gmail.com' msg = ';)' # Credentials (if needed) username = 'myusername' password = 'mypassword' # The actual mail send mailer = smtplib.SMTP('smtp.gmail.co...
more »

2017-05-02 03:05 (0) Answers

SMTPLIB, Sending email with attachment

I am trying to send an email and attach a CSV file via Gmail using Python. Sending the email works perfectly, but the CSV file is not attached to the email. Any suggestions how to proceed? Thank you in advance for the support. #Email imports import ...
more »

2017-04-05 22:04 (0) Answers

How to attach CSV file with MIME/SMTP and email?

I’m attempting to attach a CSV file and email it. Currently, I am doing the following but it simply attaches an empty CSV file, rather than attaching the CSV file I have in the same directory: import smtplib from email.mime.multipart import MIME...
more »

2017-04-04 20:04 (2) Answers

Amazon SES - Process emails stored in S3

I am using Amazon SES to receive emails. I have created the receipt rules to save all incoming emails to an S3 bucket. Now I am trying to get the S3 object from the bucket and get the email content from that. I have found from the following post that...
more »

2017-03-30 20:03 (0) Answers

HTML and Text in Python Driven Email

I am using MIMEMultipart to send emails from Python. The code is as follows: sender = "EMAIL" recipients = ["EMAIL"] msg = MIMEMultipart('alternative') msg['Subject'] = "Subject Text" msg['From'] = sender msg['To'] = ", ".join(recipients) html = P...
more »

2017-03-16 18:03 (2) Answers

email header format (PHP)

Can anyone tell me where I've gone wrong on this? I'm adding an attachment to an email from a blob in the database. I'm assuming the headers on this are incorrectly formatted but have spent all day on this and still cant get it to work! $semi_rand =...
more »

2017-03-01 19:03 (0) Answers

Input file accept only text/vtt mime types

I am trying to make input file accept webvtt subtitles, however if I do this: <input type="file" name="sub_upload" accept="text/vtt"> It still shows other files along vtt extension in file browse window. Is there a way to filer files with on...
more »

2017-02-26 12:02 (0) Answers

take email photo and send it to twitter

An email arrives on the mail server with a foto attached (a motion warning from a security camera, for example) and I would like to forward that foto to a twitter account via a DM. I think I have all the tools necessary to do this, but I haven't gott...
more »

2017-02-24 23:02 (1) Answers

SMTPlib Attachments not received

I've been using code based on the snippet at http://datamakessense.com/easy-scheduled-emailing-with-python-for-typical-bi-needs/ to send PDF attachments to customers through my company's email. We send about 100 of these at a time, through a single ...
more »

2016-11-19 03:11 (1) Answers

postfix mail server rewrites the email

I have the following problem: postfix changes the email. the email sent to postfix, and the email received as a postfix filter are not the same. It happens only if the email has illegal [header: body] fields according to the RFC. if one of his heade...
more »

2016-11-07 17:11 (0) Answers

Detect bounced emails in Python smtplib

I'm trying to catch all emails that bounced when sending them via smtplib in Python. I looked at this similar post which suggested adding an exception catcher, but I noticed that my sendmail function doesn't throw any exceptions even for fake email a...
more »

2016-11-01 23:11 (0) Answers