http://www.tutorials.de/content/1177-e-mails-mit-javamail-versenden.html
Ich versteh nicht wie ich das packet importiern muss ich nutze eclipse.
Ich versteh nicht wie ich das packet importiern muss ich nutze eclipse.
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
private class SendMailTLS implements ActionListener {
public void actionPerformed1(ActionEvent e) {
// TODO Auto-generated method stub
if(e.getSource()== drucken){
{
String host="smtp.gmail.com";
int port=587;
String user="xyz@googlemail.com";
String pass="blablub";
Properties props=new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
Session session=Session.getInstance(props);
Transport transport=session.getTransport("smtp");
transport.connect(host, port, user, pass);
Address[] addresses=InternetAddress.parse("xyz@googlemail.com");
Message message=new MimeMessage(session);
message.setFrom(new InternetAddress(user));
message.setRecipients(Message.RecipientType.TO, addresses);
message.setSubject("TEST SUBJECT");
message.setText("text/plain BODY");
transport.sendMessage(message, addresses);
System.out.println("SEND");
transport.close();}}}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}}}}
Habs ja auch erst gemacht, nachdem du den vorigen Beitrag geschrieben hast.achso hab ich nicht gesehen
private class SendMailTLS implements ActionListener {
public void actionPerformed1(ActionEvent e) {
if(e.getSource()== drucken) {
String host="smtp.gmail.com";
int port=587;
String user="xyz@googlemail.com";
String pass="blablub";
Properties props=new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
Session session=Session.getInstance(props);
Transport transport=session.getTransport("smtp");
transport.connect(host, port, user, pass);
Address[] addresses=InternetAddress.parse("xyz@googlemail.com");
Message message=new MimeMessage(session);
message.setFrom(new InternetAddress(user));
message.setRecipients(Message.RecipientType.TO, addresses);
message.setSubject("TEST SUBJECT");
message.setText("text/plain BODY");
transport.sendMessage(message, addresses);
System.out.println("SEND");
transport.close();
}
}
@Override
public void actionPerformed(ActionEvent e) {
}
}
private class SendMailTLS implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()== drucken) {
String host="smtp.gmail.com";
int port=587;
String user="xyz@googlemail.com";
String pass="blablub";
Properties props=new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
Session session=Session.getInstance(props);
Transport transport=session.getTransport("smtp");
transport.connect(host, port, user, pass);
Address[] addresses=InternetAddress.parse("xyz@googlemail.com");
Message message=new MimeMessage(session);
message.setFrom(new InternetAddress(user));
message.setRecipients(Message.RecipientType.TO, addresses);
message.setSubject("TEST SUBJECT");
message.setText("text/plain BODY");
transport.sendMessage(message, addresses);
System.out.println("SEND");
transport.close();
}
}
}