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
1
vote
1 answer

Send a mail with an attachment on my hard drive with Apache commons email

I have a problem to send an attachment in my mail with Apache commons email. To explain it quick and dirty, the mail is sent but there is no attachment at all when i look at it in Outlook. I use Apache commons email v1.4 and JAVA 8. I want to add a…
Siick
  • 491
  • 1
  • 7
  • 23
1
vote
1 answer

Where is Apache Commons Email 1.6-SNAPSHOT?

The project's homepage at (https://commons.apache.org/proper/commons-email/) has 1.6-SNAPSHOT as the latest version, published on February 26 2018. Their dependency information page…
Dmitri V
  • 65
  • 8
1
vote
1 answer

Apache Commons Email - Sending emails in a thread

I'm using Apache Commons Email to send notification emails to my users. Some emails share a topic and I would like them to be grouped in a same Conversation or Thread. I couldn't find any out-of-the-box feature in Apache commons Email…
T0ll
  • 11
  • 1
1
vote
2 answers

Java - SimpleMimeMessage does not set subject

I use Apache Commons Mail and recognised that the email subject (and other settings like character encoding) are not used at all: props.put("mail.smtp.host", "localhost"); Session s = Session.getInstance(props, null); s.setDebug(true); …
Klaus
  • 11
  • 2
1
vote
1 answer

Could not convert socket to TLS on Apache Commons Mail

I have a problem connecting to a SMTP Server with Apache Commons Mail. I have tried everything but the only thing I can find online is for Java Mail. This is my error: Caused by: javax.mail.MessagingException: Could not convert socket to TLS; …
1
vote
0 answers

HtmlEmail shows wrong format

I'm sending e-mails using this code: HtmlEmail email = new HtmlEmail(); email.setHostName("webmail.diastecnologia.com.br"); email.setSmtpPort(587); email.setAuthenticator(new DefaultAuthenticator("marcelo",…
Marcelo Dias
  • 409
  • 2
  • 18
1
vote
2 answers

html email with attachment

I'm attempting to include a zip attachment with some html content in an email using apache-commons-email 1.1. If i use this code, which sends an email without an attachment, the html body displays correctly. HtmlEmail email = new…
pstanton
  • 35,033
  • 24
  • 126
  • 168
1
vote
0 answers

SSL or TLS when sending email

I want to send email from my java application, through my gmail account. I'm using apache-commons-email 1.4. I have following code HtmlEmail email = new…
user2281439
  • 673
  • 2
  • 11
  • 19
1
vote
1 answer

Getting email text from ImageHtmlEmail

We are using apache commons mail, specifically the ImageHtmlEmail. We really would like to log every email sent - exactly as it will be sent - in the perfect world it would be something you could paste into sendmail - with all headers and other…
Darren Oakey
  • 2,894
  • 3
  • 29
  • 55
1
vote
2 answers

Java:Apache commons mail goes immediately to hotmail junk folder

Is there a way to make my email pass through these hotmail filters? In gmail the mails arrive in the inbox folder
Argiropoulos Stavros
  • 9,436
  • 11
  • 61
  • 79
1
vote
1 answer

Java mail attachment not working on Tomcat

I have an application which e-mails confirmations. The email part utilises Commons Mail API. The simple code which does the send mail is as shown below; import org.apache.commons.mail.*; ... // Create the attachment EmailAttachment attachment = new…
Bitmap
  • 12,402
  • 16
  • 64
  • 91
1
vote
1 answer

Display a functional link in an email?

I'm trying to send e-mails through my J2EE app, with Apache Commons Email library. These mails must contain some links, so I developed an HTML template, but I'm facing an odd problem : When my HTML template contains
1
vote
1 answer

How do I set Internet Proxy on Apache Commons Mail Api?

I would like to send email using a custom proxy on apache commons email api because I'm connected to the internet through a proxy server. I've tried using the common ways of setting proxies in java but it doesn't seem to work. e.g…
Andrew
  • 19
  • 7
1
vote
2 answers

Random connection problems with Amazon SES

Recently I started using Amazon SES. My first attempt was to use port 25, but I had a lot of connection problems. After some search I found that EC2 throttles port 25 traffic to avoid spam, so I changed to port 587, but from about 1000 daily emails,…
FkJ
  • 1,609
  • 1
  • 19
  • 29
1
vote
1 answer

Apache commons email always uses localhost for SMTP

Why is when I setHostName("mail.metaregistrar.com") and sending the mail to use the SMTP on localhost? Java code: SimpleEmail email = new SimpleEmail(); email.setHostName(host); email.setStartTLSEnabled(true); …
Phoenix the II
  • 135
  • 3
  • 11