1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/java/SuperPostak/src/cz/frantovo/superPostak/Pokus.java Sun Nov 23 22:19:20 2008 +0100
1.3 @@ -0,0 +1,43 @@
1.4 +package cz.frantovo.superPostak;
1.5 +
1.6 +import java.util.Properties;
1.7 +import javax.mail.Message;
1.8 +import javax.mail.Session;
1.9 +import javax.mail.Transport;
1.10 +import javax.mail.internet.InternetAddress;
1.11 +import javax.mail.internet.MimeMessage;
1.12 +
1.13 +/**
1.14 + *
1.15 + * @author fiki
1.16 + */
1.17 +public class Pokus {
1.18 +
1.19 + private static Session smtpSession;
1.20 +
1.21 + public static void main (String[] args) {
1.22 + Properties props = System.getProperties();
1.23 + props.put("mail.smtp.host", "frantovo.cz");
1.24 + //PopUpAuthenticator auth = new PopUpAuthenticator();
1.25 + smtpSession = Session.getInstance(props, null);
1.26 +
1.27 + try {
1.28 + MimeMessage message = new MimeMessage(smtpSession);
1.29 + message.setFrom(new InternetAddress("java@frantovo.cz", "SuperPošťák"));
1.30 + message.addRecipient(Message.RecipientType.TO,
1.31 + new InternetAddress("informace@frantovo.cz", "František Kučera"));
1.32 + message.setSubject("Předmět zprávy");
1.33 + message.setText("Ahoj, jak se máš? šřtžěýžééšž Java WebStart");
1.34 +
1.35 +
1.36 + Transport.send(message);
1.37 +
1.38 + } catch (Exception e) {
1.39 +
1.40 + e.printStackTrace();
1.41 + }
1.42 +
1.43 +
1.44 + }
1.45 +
1.46 +}