This is almost the same as the Google App Engine code for JavaMail use. Link
It gives a Session constructor not visible error. The other imports seem fine so why is this happening to Session?
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import java.util.Properties;
import javax.mail.Session;
import javax.mail.Message;
import javax.mail.Transport;
import javax.开发者_运维问答mail.MessagingException;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
Properties props = new Properties();
Session session = new Session(props, null);
Session
has no public constructor; you need to use the static getInstance()
or getDefaultInstance()
methods. See javadoc.
精彩评论