Bu kod ile google uygulama motorunu kullanarak basit bir e-posta göndermek için kullanıyorum. Ama hiçbir şey olmuyor, posta api kullanmak için yapılandırmam gereken bir şey var mı? Bu, localhost'ta çalışır. Posta postası olarak gmail kullanıyorum.google app engine ile e-posta gönderimi
String host = "smtp.google.com";
String to = "[email protected]";
String from = "[email protected]";
String subject = "this is a test";
String messageText = "test";
boolean sessionDebug = false;
// Create some properties and get the default Session.
Properties props = System.getProperties();
props.put("mail.host", host);
props.put("mail.transport.protocol", "smtp");
Session mailSession = Session.getDefaultInstance(props, null);
// Set debug on the Session
// Passing false will not echo debug info, and passing True will.
mailSession.setDebug(sessionDebug);
// Instantiate a new MimeMessage and fill it with the
// required information.
Message msg = new MimeMessage(mailSession);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = { new InternetAddress(to) };
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(subject);
msg.setSentDate(new Date());
msg.setText(messageText);
// Hand the message to the default transport service
// for delivery.
Transport.send(msg);
GAE projesinden e-posta göndermenin bir yolu yok mu? Ya da sadece bu şekilde kullanmıyor musunuz? – Nick
Yalnızca belirli adreslerden ve yerel geliştirme sunucusundan sadece konsola e-postaları kaydedebilirsiniz. – jimr