I have problem using vesijama (Very Simple Java Mail)
Posted
by Huuhaacece
on Stack Overflow
See other posts from Stack Overflow
or by Huuhaacece
Published on 2010-05-21T14:56:27Z
Indexed on
2010/05/21
15:20 UTC
Read the original article
Hit count: 256
Hi, i already read this tutorial from here and i have download all required libraries (Log4j, JavaMail API ,Activation framework) . But when i trying running this program i got this error
log4j:WARN No appenders could be found for logger (org.codemonkey.vesijama.Mailer). org.codemonkey.vesijama.MailException: Generic error: Exception reading response log4j:WARN Please initialize the log4j system properly.
this is the source code i use
import javax.mail.Message.RecipientType;
import org.codemonkey.vesijama.Email;
import org.codemonkey.vesijama.MailException;
import org.codemonkey.vesijama.Mailer;
public class testSend {
final Email email = new Email();
public testSend{
try{
email.setFromAddress("test", "[email protected]");
email.setSubject("hey");
email.addRecipient("hai", "[email protected]", RecipientType.TO);
email.setText("We should meet up!");
email.setTextHTML("<b>We should meet up!</b>");
new Mailer("smtp.gmail.com", 465, "[email protected]", "XXXXXX").sendMail(email);
}
catch(MailException me)
{
System.out.println(me);
}
}
}
i have also trying using port 587. but i got same error >.<
btw , it say can add attachments what should i write if i want to attach .xls ( microsoft excel 2003) ?
Thx B4.
© Stack Overflow or respective owner