|
PessoaALL !!!
Tenho este metodo:
public void sendMessage(String subject, String
msgText, File attach) throws MessagingException {
if(subject!=null) {
message.setSubject(subject);
}
// create and fill the first message
part
MimeBodyPart mbp1 = new
MimeBodyPart();
mbp1.setText(msgText); // create the second message part MimeBodyPart mbp2 = new MimeBodyPart(); // attach the file to the message FileDataSource fds=new FileDataSource(attach); mbp2.setDataHandler(new DataHandler(fds)); mbp2.setFileName(attach.getName()); // create the Multipart and its parts
to it
Multipart mp = new MimeMultipart(); mp.addBodyPart(mbp1); mp.addBodyPart(mbp2); // add the Multipart to the
message
message.setContent(mp); message.setSentDate(new
Date());
Transport.send(message);
} O meu metodo main est� da seguinte
maneira:
static public void main(String[] args)
{
Date dI = new Date SMTPFasterMailDispatcher mailDis = new SMTPFasterMailDispatcher("linux1.travelnet.com.br", "Subject Teste", "[EMAIL PROTECTED], null, null); try { for(int i=0; i<10;i++) { mailDis.sendMessage("Teste" + i, "Subject Teste", "SMTPFasterMailDispatcher.class"); } } catch (MessagingException msgExc) { msgExc.printStackTrace(); } Date dF = new Date(); System.out.println("Data Inicial: " + dI); System.out.println("Data Final : " + dF); } Quando eu tento compilar d� a seguinte mensagem de
erro:
"SMTPFasterMailDispatcher.java": Error #: 300 :
method sendMessage(java.lang.String, java.lang.String, java.lang.String) not
found in class com.vesper.vesperapp.util.mail.SMTPFasterMailDispatcher at line
114, column 41
Eu acredito que ao inv�s do metodo entender um
arquivo tipo File, ele est� entendendo uma String !!!
Como eu passo parametro para que ele reconhe�a um
arquivo tipo file ?
Muito Obrigado
[] 's
Kleber Rodrigo de Carvalho Software Engineer |
