Link to home
Start Free TrialLog in
Avatar of Ivo Raemy
Ivo Raemy

asked on

In Liferay, I like to create an email with 400 emails in BCC

Hello

In Liferay, I like to create an email.
Il seams that Liferay does not support java.awt.Desktop. 

(desktop.mail(new URI(sourceURL));)


Desktop.isDesktopSupported() returns false


I try with mailto.


I use the code


Page.getCurrent().getJavaScript().execute(
 "window.location.href='" + new ExternalResource(sourceURL).getURL() + "';");


where sourceURL= mailto:test.pesonne@mail.com?subject=Test&bcc=[List of emails];


However: the url for mailto is limited to 2000 char.


So, I split the email liste and call Page.getCurrent().getJavaScript().execute()  more than one time, but only the first call creates an email. The other calls are ignored.

Is there a way to create more that one email in a call?


Or even better, to create in Liferay an email with more than 2000 chars in the url?

Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

I do not recommend using mailto to add more than 2000 chars

What is the issue of no support of desktop.mail(new URI(sourceURL))  - if you can generate the email for a mailto, you should be able to use it to call SMTP

https://www.solutionanalysts.com/blog/send-email-liferay-portal/
Avatar of Ivo Raemy
Ivo Raemy

ASKER

Thank you for your answer.

The code should not send an email. It should open an email in the default mail client.
With the parameters
  • from
  • bcc
  • subject
or, alternatively, if there are to much emails, open more than one email with max 70 adresses in bcc (to respect the limit of 2000 chars in mailto)
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial