Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
String mailTo = "mail@irgendwas.de";
URI uriMailTo = null;
if(Desktop.isDesktopSupported()){
Desktop desktop = Desktop.getDesktop();
try {
uriMailTo = new URI("mailto", mailTo, null);
desktop.mail(uriMailTo);
} catch (URISyntaxException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
String mailTo = "mail@irgendwas.de";
String body = "Meine%20Nachricht";
String subject = "Meine%20Betreffzeile";
URI uriMailTo = null;
if(Desktop.isDesktopSupported()){
Desktop desktop = Desktop.getDesktop();
try {
uriMailTo = new URI("mailto:"+mailTo+"?SUBJECT="+subject+"&BODY="+body);
desktop.mail(uriMailTo);
} catch (URISyntaxException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
Genau das habe ich gemeint. Die E-Mail Nachricht wird angezeigt mit den entsprechenden Parametern. Kann man sie verschicken direkt aus dem Code?