Questions tagged [apache-commons-email]

Apache Commons Email aims to provide a API for sending email. It is built on top of the Java Mail API, which it aims to simplify.

Apache Commons Email aims to provide a API for sending email. It is built on top of the Java Mail API, which it aims to simplify.

Some of the mail classes that are provided are as follows:

  • SimpleEmail - This class is used to send basic text based emails.
  • MultiPartEmail - This class is used to send multipart messages. This allows a text message with attachments, either inline or attached.
  • HtmlEmail - This class is used to send HTML formatted emails. It has all the capabilities of MultiPartEmail, allowing attachments to be easily added. It also supports embedded images.
  • ImageHtmlEmail - This class is used to send HTML formatted emails with inline images. It has all the capabilities of HtmlEmail but transforms all image references to inline images.
  • EmailAttachment - This is a simple container class to allow for easy handling of attachments. It is for use with instances of MultiPartEmail and HtmlEmail.

Official Website: http://commons.apache.org/email/

Useful Links:

Related Tags:

86 questions
2
votes
2 answers

Apache Commons Email install in Eclipse: cannot be resolved

I'm sorry, I do not have enough reputation to comment on others posts, so I have to ask a new Question. I'm on ubuntu Linux 11.10, and I'm trying to install the Commons Email in eclipse. But the only files I can download is tar.gz and .zip. These…
Strammefar
  • 57
  • 4
2
votes
1 answer

org.apache.commons.mail.util.MimeMessageParser never ends parsing

I have some code to parse incoming mails. I use org.apache.commons.mail.util.MimeMessageParser for this.The problem occurs in the following method: private String getActionDescription(Message message) throws Exception { MimeMessage mimeMessage =…
Tom
  • 4,096
  • 2
  • 24
  • 38
2
votes
1 answer

What is the best way to get text from .eml file?

I try to get to, from, topic and message body from several eml files which are on my local drive. Now I've tried to use Apache Commons Email, but sometimes it loops with no errors. Here is my code which supposed to get text from eml and save it to…
ComradDart
  • 33
  • 1
  • 6
2
votes
1 answer

Why attachment file name broken when using the apache-email library?

The mail was send using the apache-email library.(commons-email-1.5.jar) If the Korean language is included in the attachment file name, the attachment file name is broken. What is the way for filename to be sent normally? Do not use javax.mail-api…
2
votes
2 answers

How to receive and distinguish between regular attachments and inline attachments in Apache Commons Email 1.4

Currently we receive an email which gets parsed by MimeMessageParser mimeMessageParser = parse(message); and later pull out the attachments with if (mimeMessageParser.hasAttachments()) { List attachments =…
bytor99999
  • 726
  • 7
  • 26
2
votes
1 answer

Sending email using Apache mail is not saved in the sent folder

I am using Apache Commons Mail library to send email (using their simple SMTP email example). The email is sent using one of the famous providers (i used yahoo as an example). The email was sent successfully. However when I login to my yahoo account…
Snake
  • 14,228
  • 27
  • 117
  • 250
2
votes
0 answers

Apache commons Email Alias Not working Properly in scala

I am using HtmlEmail Class of ApacheCommons for sending HTML formatted email with embedded images Apache Commons Email API (v1.4) is used in my Scala project I am not Seeing the Alias (MY REPORTS) as sender name in my Received Email Following is my…
axnet
  • 5,146
  • 3
  • 25
  • 45
2
votes
1 answer

Mail doesn't get sent out using Apache Commons Mail

I'm using version 1.3.3 Apache Commons Mail for sending out emails. I've tried changing the Apache mail version using telnet smtp.gmail.com 587 to test for connectivity (it works, so its not about the firewall) trying out with different ports…
2
votes
2 answers

Substitute sender email address with a name in Apache commons email

Is there a way to show sender's name instead of an e-mail address when sending an e-mail? This is what I'm currently doing : Email email = new HtmlEmail().setStartTLSRequired(true); email.setDebug(false); email.setHostName("smtp.test.ch"); …
andreybavt
  • 1,301
  • 4
  • 17
  • 32
2
votes
1 answer

Using apache commons email library getting error must issue a starttls command first. Please help

Email email = new SimpleEmail(); String authuser = "......@gmail.com"; String authpwd = "*******"; // Very Important, Don't use email.setAuthentication() email.setSmtpPort(587); email.setAuthenticator(new DefaultAuthenticator(authuser,…
2
votes
5 answers

Javamail / email commons: empty message gives strange error

I'm trying to send an email message via GMail (Google Apps, actually). This works perfectly for normal messages, but of course I have to test the extremes. Right now I'm trying to send a message without a body and I'm getting a strange error…
bartlaarhoven
  • 825
  • 2
  • 8
  • 21
2
votes
1 answer

Why is this URL not opened from Play! Framework 1.2.4?

I have a URL in my Play! app that routes to either HTML or XLSX depending on the extension that is passed in the URL, with a routes line like :- # Calls GET /calls.{format} Call.index so calls.html renders the page,…
2
votes
1 answer

How to send an email with an attachment from Play! Framework 1.2.4

Trying to get Play! Framework to send an email with an attachment. Code below works fine if I don't add the attachment to the message. I've tried both with Play's Mailer class and with the Apache Commons classes (as below), but in both cases, the…
Rob Cowell
  • 1,610
  • 3
  • 18
  • 34
1
vote
2 answers

sending an email with an embedded Image

i'm trying to send html emails that embed a logo and an image of the user's signature. I'm using apache commons mail. I've followed Apache's site tutorial and tried different approaches found around on the web, yet i'm not able to embed any image .…
user260192
1
vote
2 answers

Commons email example hanging on send()

I'm trying to get this example for the Apache Commons email library to work. Here is my code: SimpleEmail email = new SimpleEmail(); email.setHostName("smtp.gmail.com"); email.setSmtpPort(465); email.setAuthenticator(new…
andronikus
  • 4,125
  • 2
  • 29
  • 46