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
0
votes
2 answers

How to automate sending attachments through GMail using Selenium java

I am doing test automations for the first time, and I want to be able to automate gmail and send an email with an attachment. I am using selenium web driver, cucumber and google chrome to run the tests. My IDE is intelliJ. My tests work up until I…
0
votes
1 answer

How to connect smtp port 25 in second time?

I am using Apache commons mail to send mail in my web application. My web application is hosted in Tomcat. When I try to send mail for the first time after server starts. I am able to send mail. But after that, when I attempted second time, it is…
Manoj
  • 5,707
  • 19
  • 56
  • 86
0
votes
2 answers

Send HTML email with an pdf attachment by using Java

I am trying to send an email with Java, I am using apache commons email library. I cannot achieve to send an email with a body as HTML and an attachment as PDF (or any file type) If I use EmailAttachment() and add it to an HtmlEmail object, my mail…
Tim Tuckle
  • 1,372
  • 7
  • 21
  • 31
0
votes
1 answer

Apache commons-email 1.4 send HtmlEmail without translating html tag and also not see the attachment

I am using apache commons email 1.4 to send html email with attached pdf. However, the email I got is

B600003292

MIME-Version: 1.0 Content-Type: multipart/mixed; …
Laodao
  • 1,547
  • 3
  • 17
  • 39
0
votes
1 answer

send mail in java without javax.mail

Ok so is there any other library in java for sending emails? I tried to use javax.mail and commons-email and I keep getting this error: Exception in thread "Thread-645" java.lang.UnsupportedOperationException: Method not yet implemented at…
kitsuneFox
  • 1,243
  • 3
  • 18
  • 31
0
votes
1 answer

Apache Commons Email in Jboss send bad html email

Given the following snippet of code: public static void main(String[] args) throws Exception { final Email email = new SimpleEmail(); email.setHostName("smtp.gmail.com"); email.addTo("me@gmail.com", "Manuel"); …
rascio
  • 8,968
  • 19
  • 68
  • 108
0
votes
1 answer

Apache commons mail Exception..Recipient address rejected: User unknown in virtual alias table

I have two emails of my own domain. One is configured in the domain and other is configured in gmail (admin.google.com). My code HtmlEmail htmlEmail = new HtmlEmail(); htmlEmail.setHostName("mydomain.com"); htmlEmail.setSmtpPort(587); …
Alan George
  • 13
  • 1
  • 4
0
votes
2 answers

MimeMessageParser unable to fetch from address

We have been stuck with this issue for quite some time now.In our project we are trying to parse an email that is written on to a file and get the data into the pojo. It works for most cases but when the email id is too long the mail id goes to the…
Lakshmi
  • 2,204
  • 3
  • 29
  • 49
0
votes
1 answer

Apache Commons Email work with "normal gmail", but not "Gmail for work"?

Hi I'm using the following code to send email: public static void sendEmail(String from, String to, String password) { Email email = new SimpleEmail(); email.setHostName("smtp.googlemail.com"); email.setSmtpPort(465); …
Scott Mayers
  • 437
  • 6
  • 18
0
votes
1 answer

imagehtmlemail sending as text/plain

we have some code that uses imagehtmlemail, from apache commons. From most machines it works perfectly, sends out a html email with an embedded image - but from some machines - with exactly the same code, exactly the same smtp server, and inside…
Darren Oakey
  • 2,894
  • 3
  • 29
  • 55
0
votes
1 answer

commons-email HTML message problems

Hopefully just a quick one. Essentially I am using apache commons email v1.3.3 and I am trying to send a HTML format email. I have followed their user guide to do this however the email I am receiving is just not resolving to HTML in any client I…
dapperwaterbuffalo
  • 2,672
  • 5
  • 35
  • 48
0
votes
1 answer

error while sending email in Java using Apache Commons email libs

I was trying to use Apache Commons library to send email. But it gives me an error saying "the type of setAuthenticator(Authenticator) is erroneous" in email.setAuthenticator function. Here is my code. I am not sure why I get this error. public…
0
votes
1 answer

org.apache.commons.mail.MultiPartEmail sends email with empty body

Sending email org.apache.commons.mail.MultiPartEmail.send() sends email with empty body. I have tried with commons-email 1.2, 1.3.1, 1.3.3. Java 1.7.0_55 was the earliest version which caused the empty email body.
Egil Saga
  • 43
  • 9
0
votes
1 answer

Apache commons-mail HtmlEmail with attachment: html is attached as noname.html in Gmail

I use the apache commons-mail (v1.3.2) to send an order confirmation e-mail with a PDF as attachment. The e-mail displays without problems in outlook (both web and desktop) but when I send to my gmail account, the content of the mail is empty and…
nexana
  • 1,096
  • 1
  • 9
  • 18
0
votes
1 answer

MimeMessageParser throws ClassCastException for HtmlEmail

I'm trying to use MimeMessageParser to parse HtmlEmail to get Html and Plain text body parts: def emailForAutomation(email: HtmlEmail): String = { email.buildMimeMessage() val mimeMessage = email.getMimeMessage() val parser = new…
alboko
  • 488
  • 5
  • 15