** High Priority **

Pessoal,

  Estou desenvolvendo uma aplica��o para envio de e-mail, mas ao tentar enviar o email 
recebo uma exception que n�o consigo resolver. Alguem sabe me dizer o pq que ocorre 
esta exception e como posso resolve-la ?

************ SendMessage.java **********************

import java.util.*;

import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;

public class SendMessage {

  public static void main(String[] args) {

    String host = "10.1.1.17";
    String to = "[EMAIL PROTECTED],br";
    String from = "[EMAIL PROTECTED],br";
    String subject = "JSP Rules!";
    String messageText = "I am sending a message using the" + " JavaMail API.\nI can 
include any text that I want.";
    boolean sessionDebug = false;

    Properties props = System.getProperties();
    props.put("mail.host", host);
    props.put("mail.transport.protocol", "smtp");

    Session session = Session.getDefaultInstance(props, null);

    session.setDebug(sessionDebug);

    try {

      Message msg = new MimeMessage(session);

      msg.setFrom(new InternetAddress(from));
      InternetAddress[] address = {new InternetAddress(to)};
      msg.setRecipients(Message.RecipientType.TO, address);
      msg.setSubject(subject);
      msg.setSentDate(new Date());
      msg.setText(messageText);
      Transport.send(msg);

    }
    catch (MessagingException mex) {

      mex.printStackTrace();
    }
  }
}

*********************************************************

*************** Exception *****************************

javax.mail.NoSuchProviderException: No provider for Address type: rfc822
        java.lang.Throwable(java.lang.String)
        java.lang.Exception(java.lang.String)
        javax.mail.MessagingException(java.lang.String)
        javax.mail.NoSuchProviderException(java.lang.String)
        javax.mail.Transport javax.mail.Session.getTransport(javax.mail.Address)
        void javax.mail.Transport.send0(javax.mail.Message, javax.mail.Address [])
        void javax.mail.Transport.send(javax.mail.Message)
        void SimpleSendMessage.main(java.lang.String [])

**********************************************************

       Gustavo Barreiro
[EMAIL PROTECTED]


------------------------------ LISTA SOUJAVA ----------------------------
http://www.soujava.org.br  -  Sociedade de Usu�rios Java da Sucesu-SP
d�vidas mais comuns: http://www.soujava.org.br/faq.htm
regras da lista: http://www.soujava.org.br/regras.htm
para sair da lista: envie email para [EMAIL PROTECTED]
-------------------------------------------------------------------------

Responder a