활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
I am trying to send mail using Aem 6.1. The functionality works correct in when inbuilt jetty server is used. But when the same is deployed on weblogic 12c, it fails with java.lang.linkage error.
There is a article on helpx.adobe.com knowledge base which also acknowledges the issue but it didnt work for me - https://helpx.adobe.com/experience-manager/kb/using-java-mail—java-activation-with-weblogic.html
Is there is a more detailed documentation available on the exact steps to be done to resolve the issue?
Regards,
Anil
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
Hi Anil,
Check this article with Java mail API: https://helpx.adobe.com/experience-manager/using/creating-custom-cq-email-services.html
Thanks,
Ratna Kumar.
조회 수
답글
좋아요 수
To send email from AEM, write an OSGi bundle that uses Java Mail API and you can send email. Now having said that - there may be libs that you need to deploy in bundle fragments to get an OSGi bundle using Java mail API working.
조회 수
답글
좋아요 수
Hi Anil Kumar
As correctly mentioned by Scott, that you may write an OSGI bundle and can call it using Sling servlet or as a Service. Please have a look at the code below:-
String to = "sonoojaiswal1988@gmail.com";//change accordingly
String from = "sonoojaiswal1987@gmail.com";change accordingly
String host = "localhost";//or IP address
//Get the session object
Properties properties = System.getProperties();
properties.setProperty("mail.smtp.host", host);
Session session = Session.getDefaultInstance(properties);
//compose the message
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
message.setSubject("Ping");
message.setText("Hello, this is example of sending email ");
// Send message
Transport.send(message);
System.out.println("message sent successfully....");
You may use this code in doPost/doGet methods of OSGi when using it as Sling Servlet else you can use in some method of OSGI class and can invoke from JSP when using it as OSGI service.
I hope this will help you.
Thanks and Regards
Kautuk Sahni
조회 수
답글
좋아요 수
Thanks, our code is very similar to what you suggested. Have you tried executing this on RHEL 6.6 and WLS12c?
조회 수
답글
좋아요 수
Then why the special knowledge base on the helpx.adobe,com was required???
조회 수
답글
좋아요 수
Hi Anil,
Check this article with Java mail API: https://helpx.adobe.com/experience-manager/using/creating-custom-cq-email-services.html
Thanks,
Ratna Kumar.
조회 수
답글
좋아요 수
which version of java activation are you using ?? Also can you give more details on your JRE , AEM versions ?
조회 수
답글
좋아요 수
AEM is 6.1 and JRE is 1.7. I can provide you the exact information in couple of hours. Is there any specific information you are looking for about java activation?
I tried sending mail using a servlet deployed on the same weblogic and the mails were being sent correctly.
조회 수
답글
좋아요 수