Ciao a tutti sto usando questo script per l'invio di email:
<%@ page contentType="text/html" language="java" import="java.util.*, javax.mail.*, javax.mail.internet.*, javax.activation.*"%>
<%
String smtpHost = mio server di posta;
Properties props = System.getProperties();
props.put("mail.smtp.host", smtpHost);
Session c = Session.getDefaultInstance(props, null);
String from = indirizzo di posta;
String to = mia casella di posta;
MimeMessage message = new MimeMessage(c);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject("PROVA OGGETTO");
Multipart multipart = new MimeMultipart();
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setText("CORPO MESSAGGIO");
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
Transport.send(message);
%>
ma mi risponde:
org.apache.jasper.JasperException: Sending failed;
nested exception is:
class javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class javax.mail.SendFailedException: 550 5.7.1 ... Relaying denied
cosa potrebbe essere?