envio de mails desde java
saluti to everybody...
me gustaria saber como enviar codigo html desde mis clases java por SMTP.
El asunto es que quiero que el usuario receptor del mail visualice una pagina web al abrir el mismo.
molto grace¡
me gustaria saber como enviar codigo html desde mis clases java por SMTP.
El asunto es que quiero que el usuario receptor del mail visualice una pagina web al abrir el mismo.
molto grace¡
Puedes utilizar el API JavaMail
http://java.sun.com/products/javamail/index.html
http://java.sun.com/products/javamail/index.html
A ver si puede ayudarme alguien, please
Este es el error que me aparece siempre
k lanzo el metodo send de la clase Transport.
Como parametros le envio el MimeMessage cargado
con todo ==> from, to, texto, textoHtml....
Mensaje de error:
Enter message, end with "." on a line by itself
Gracias de antemano
Este es el error que me aparece siempre
k lanzo el metodo send de la clase Transport.
Como parametros le envio el MimeMessage cargado
con todo ==> from, to, texto, textoHtml....
Mensaje de error:
Enter message, end with "." on a line by itself
Gracias de antemano
Nunca me ha aparecido ese error, y este es el metodo que yo uso para enviar correos.
public void send(String from, String to, String subject, String text)
throws MessagingException {
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", host);
// Get session
Session session = Session.getDefaultInstance(props, null);
// Define message
MimeMessage message = new MimeMessage(session);
// Set the from address
message.setFrom(new InternetAddress(from));
// Set the to address
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
// Set the subject
message.setSubject(subject);
// Set the content
message.setText(text);
// Send message
Transport.send(message);
}
public void send(String from, String to, String subject, String text)
throws MessagingException {
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", host);
// Get session
Session session = Session.getDefaultInstance(props, null);
// Define message
MimeMessage message = new MimeMessage(session);
// Set the from address
message.setFrom(new InternetAddress(from));
// Set the to address
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
// Set the subject
message.setSubject(subject);
// Set the content
message.setText(text);
// Send message
Transport.send(message);
}