cancel
Showing results for 
Search instead for 
Did you mean: 

Send mail inside Portal Application

Former Member
0 Kudos

Hi everyone:

I need to send a mail inside a portal application, using the user logged email and send to other portal user. I need to know any solutions, because is very urgent, I was testing with Transport.send(msgMail); with this libraries:

import javax.mail.Message;

import javax.mail.MessagingException;

import javax.mail.Session;

import javax.mail.Transport;

import javax.mail.internet.InternetAddress;

import javax.mail.internet.MimeMessage;

import javax.servlet.http.HttpServletRequest;

but nothing happened.

I'm trying with IMailItem, ISendTransport..... but I need help with the implementation.... (Collaboration apis)

Help please.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Leslie,

first you have to refer to the needed j2ee libary

@see:

then proceed by using common javax.mail implementation...

Properties props = new Properties();

props.put("mail.smtp.host", "mailserver.com");

Session s = Session.getInstance(props,null);

InternetAddress from = new InternetAddress("mail@mail.com");

InternetAddress to = new InternetAddress(recepeint@server.com");

MimeMessage message = new MimeMessage(s);

message.setFrom(from);

message.addRecipient(Message.RecipientType.TO, to);

message.setSubject("Your subject");

message.setText("Your text");

Transport.send(message);

Regards, Jens