!7 lib 1400085 // JavaMail sS recipient = "info@botcompany.de"; //"stefan.reich.maker.of.eye@gmail.com"; import javax.mail.*; import javax.mail.PasswordAuthentication; import javax.mail.internet.*; p { final S username = "stefan.reich.maker.of.eye@gmail.com"; final S password = loadSecretTextFileMandatory("gmail-pw").trim(); new Properties props; props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.port", "587"); Session session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } }); Message message = new MimeMessage(session); message.setFrom(new InternetAddress(username)); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipient)); message.setSubject("Testing Subject"); message.setText("Dear Mail Crawler," + "\n\n No spam to my email, please!"); Transport.send(message); print("Done"); }