Hi all,
I want to send an email. I have this code.
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
Properties p = new Properties();
p.put("mail.transport.protocol", "smtp");
p.put("mail.smtp.host", "server name");
p.put("mail.smtp.port", "25");
String subject = sub.getValue().toString();
TextEdit body =
(TextEdit) this.getPageContext().getComponentForId(
"Message");
String bodystr = body.getText();
MimeMessage m = new MimeMessage(s);
InternetAddress myAddress =
new InternetAddress(user.getEmail());
recipientAddress = new InternetAddress(email);
m.setFrom(myAddress);
m.setRecipient(Message.RecipientType.TO, recipientAddress);
m.setSubject(subject);
m.setContent(bodystr, "text/plain");
Transport.send(m);
I cant import those libraries. It seems they are missing. (import is underlined and says: The import cant be resolved) What should I do? Where can I get those libraries?
PLS help.
Ivo