Ciao andbin!
Io ho trovato questo:
"public static void mailto(List<String> recipients, String subject,
String body) throws IOException, URISyntaxException {
String uriStr = String.format("mailto:%s?subject=%s&body=%s",
join(",", recipients), // use semicolon ";" for Outlook!
urlEncode(subject),
urlEncode(body));
Desktop.getDesktop().browse(new URI(uriStr));
}
private static final String urlEncode(String str) {
try {
return URLEncoder.encode(str, "UTF-8").replace("+", "%20");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
public static final String join(String sep, Iterable<?> objs) {
StringBuilder sb = new StringBuilder();
for(Object obj : objs) {
if (sb.length() > 0) sb.append(sep);
sb.append(obj);
}
return sb.toString();
}
public static void main(String[] args) throws IOException, URISyntaxException {
mailto(Arrays.asList("", ""), "Hello!",
"This is\nan automatically sent email!\n");
}"
Però mi da un errore su "Desktop.getDesktop().browse(new URI(uriStr));" , ovvero "This inspection finds all usage of methods that have @since tag in their documentation. This may be useful when development is performed under newer SDK version as the target platform for production."
Hai qualche consiglio/soluzione? Sai dove potrei trovare degli esempi ed un po di documentazione su come attivare questo servizio di mailing?