Questions tagged [attachment]

Any additional content added to a digital object, such as an email attachment.

Many languages provide facilities for sending email or transmitting other data (e.g. SOAP) but may not always provide a clear interface for attaching documents or other arbitrary binary data to the message or object.

This tag is for all questions relating to adding attachments to transmitted data or providing an interface for doing so.

2942 questions
33
votes
7 answers

Downloading multiple attachments using imaplib

How can I download multiple attachments from a single mail using imaplib? Let's say I have an e-mail and that e-mail contains 4 attachments. How can I download all of those attachments? The code below only downloads a single attachment from an…
harde
  • 331
  • 1
  • 3
  • 3
32
votes
2 answers

How to create an email with embedded images that is compatible with the most mail clients

We have created a system that allows embedding an image in an outgoing email. Here is the original message our system creates. This example contains an image attachment and an embedded image. Mime-Version: 1.0 From: ... To: ... CC: Subject:…
700 Software
  • 85,281
  • 83
  • 234
  • 341
31
votes
6 answers

add excel file attachment when sending python email

How do i add a document attachment when sending an email with python ? i get the email to send (please ignore: i am looping the email to send every 5 seconds, only for testing purposes, i want it to send every 30 min, just have to change 5 to…
soccerplayer
  • 1,017
  • 1
  • 8
  • 10
31
votes
4 answers

C# MailTo with Attachment?

Currently I am using the below method to open the users outlook email account and populate an email with the relevant content for sending: public void SendSupportEmail(string emailAddress, string subject, string body) { Process.Start("mailto:" +…
Goober
  • 13,146
  • 50
  • 126
  • 195
30
votes
8 answers

JavaMail sending mail attachment from string - encoding UTF-8

My application has to send a textfile, which it first has to generate as a String. The text contains non-ASCII symbols, so i would like it to be UTF-8. I've tried a lot of variants, but all i receive as the attachment is some question marks. And,…
Ibolit
  • 9,218
  • 7
  • 52
  • 96
30
votes
1 answer

Slack Attachment Width and Wrapping Issues

I'm trying to use slack attachments to log application errors but the large fields like the stack trace are behaving weirdly. First, when using attachments the table seems to be fixed to some arbitrary width, is there anyway to change this so a…
JWrightII
  • 942
  • 11
  • 26
29
votes
2 answers

Sending emails with attachment in django

I'm trying to send email with some images attached in django. Code used is this snippet : http://www.djangosnippets.org/snippets/1063/. I don't know, why the attachment part returns me a core error. The code. forms.py from django import forms from…
sasklacz
  • 3,610
  • 10
  • 39
  • 58
28
votes
5 answers

Downloading attachments to directory with IMAP in PHP, randomly works

I found PHP code online to download attachments to a directory using IMAP from here. http://www.nerdydork.com/download-pop3imap-email-attachments-with-php.html I modified it slightly changing $structure = imap_fetchstructure($mbox, $jk); …
Nick
  • 281
  • 1
  • 3
  • 5
27
votes
13 answers

Sending mails with attachment via NodeJS

Is there any library for NodeJS for sending mails with attachment?
sdepold
  • 6,171
  • 2
  • 41
  • 47
25
votes
8 answers

Not losing paperclip attachment when model cannot be saved due to validation error

The scenario is a normal model that contains a paperclip attachment along with some other columns that have various validations. When a form to to create an object cannot be saved due to a validation error unrelated to the attachment, columns like…
peanutbutter
  • 261
  • 3
  • 5
25
votes
6 answers

How do I send attachments using SMTP?

I want to write a program that sends email using Python's smtplib. I searched through the document and the RFCs, but couldn't find anything related to attachments. Thus, I'm sure there's some higher-level concept I'm missing out on. Can someone…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
23
votes
5 answers

How do I add an attachment to an email using System.Net.Mail?

I have an excel document represented as a byte[] and I'm wanting to send it as an attachment in an email. I'm having a bit of trouble constructing the attachment. I can create an Attachment which has the following constructors: (Stream…
mezoid
  • 28,090
  • 37
  • 107
  • 148
22
votes
5 answers

HTTP response header content disposition for attachments

Background Write an XML document to a browser's response stream and cause the browser to display a "Save As" dialog. Problem Consider the following download() method: HttpServletResponse response = getResponse(); BufferedWriter bw = new…
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
22
votes
1 answer

Grails File Download

I'm trying to craete a site which allows users to upload any file type they like. I've implemented this feature fine, and the file is held on the server. Later on they can download the file to view, but i'm having trouble getting it to work. I've…
James Camfield
  • 1,636
  • 3
  • 16
  • 24
21
votes
5 answers

Android Attaching a file to GMAIL - Can't attach empty file

I had a program that would always attach the same file to GMAIL (Compose > Attach File > Open From > "MyProgram"). It would always select the same file. What it was doing was: String path = Environment.getExternalStorageDirectory() +…
GuiFGDeo
  • 706
  • 1
  • 8
  • 29