I have an agent that uses javamail to send a note to a user from a WebQuerySave event, when the agent is run manually from the notes client, it works correctly. When the agent is run from the web form’s WebQuerySave event it throws an exception, details as below.HTTP JVM: javax.mail.NoSuchProviderException: No provider for Address type: rfc822
HTTP JVM: at javax.mail.Session.getTransport(Session.java:516)
import lotus.domino.*;
import java.util.Vector;
import java.util.*;
import javax.activation.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.naming.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Properties props = new Properties();
//set up mail server
props.put("mail.smtp.host","13EXCH01" );
props.put("mail.transport.protocol", "smtp");
javax.mail.Session mailSession = javax.mail.Session.getDefaultInstance(props, null);
lotus.domino.Session NotesSession = getSession();
MimeMessage message = new MimeMessage(mailSession);
message.setContent("Hello", "text/plain");
message.setSubject("First");
Address address = new InternetAddress("lowell.small@englobal.com");
Address toaddress = new InternetAddress("lowell.small@englobal.com");
message.addRecipient( MimeMessage.RecipientType.TO, toaddress);
message.setFrom (address);
//send message
Transport.send(message);
} catch(Exception e) {
e.printStackTrace();
}
}
}