일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- 오라클
- DB
- 톰캣
- 에러
- 기타소득
- 엑셀
- oracle
- 함수
- 자바
- 튜닝
- java
- Tomcat
- MIP
- Excel
- miplatform
- Eclipse
- 마이플랫폼
- 도서
- 이클립스
- JEUS
- Report Designer
- 성능
- 태그를 입력해 주세요.
- JavaScript
- 회계
- Book
- 한글
- 오류
- 데이터베이스
- error
Archives
- Today
- Total
어느 가을날의 전환점
JAVA|자바로 메일 보내기(Apache Commons Email) 본문
Apache Commons Email
* website: http://commons.apache.org/email/
* wiki: http://wiki.apache.org/commons/Email
* api: http://commons.apache.org/email/api-release/index.html
* website: http://commons.apache.org/email/
* wiki: http://wiki.apache.org/commons/Email
* api: http://commons.apache.org/email/api-release/index.html
Commons Email aims to provide a API for sending email. It is built on top of the Java Mail API, which it aims to simplify.
Some of the mail classes that are provided are as follows:
* SimpleEmail - This class is used to send basic text based emails.
* MultiPartEmail - This class is used to send multipart messages. This allows a text message with attachments either inline or attached.
* HtmlEmail - This class is used to send HTML formatted emails. It has all of the capabilities as MultiPartEmail allowing attachments to be easily added. It also supports embedded images.
* EmailAttachment - This is a simple container class to allow for easy handling of attachments. It is for use with instances of MultiPartEmail and HtmlEmail.
A simple text email
Email email = new SimpleEmail(); email.setHostName("smtp.gmail.com"); email.setSmtpPort(587); email.setAuthenticator(new DefaultAuthenticator("username", "password")); email.setTLS(true); email.setFrom("user@gmail.com"); email.setSubject("TestMail"); email.setMsg("This is a test mail ... :-)"); email.addTo("foo@bar.com");email.send();
#참조
1) http://commons.apache.org/email/userguide.html
2) http://javacan.tistory.com/entry/117
3) javax.mail Library 사용 예제: http://www.okjsp.pe.kr/seq/186937
2) http://javacan.tistory.com/entry/117
3) javax.mail Library 사용 예제: http://www.okjsp.pe.kr/seq/186937
'Development' 카테고리의 다른 글
DOS|텍스트(text, .txt) 파일 병합 방법 (0) | 2012.05.24 |
---|---|
TOMCAT|톰켓 web.xml의 Servlet 로드 옵션 <load-on-startup> (0) | 2012.03.28 |
JAVASCRIPT|팝업 창에서 부모 창의 함수 호출 방법(opener) (0) | 2012.03.14 |
JAVA|자바 소스 코드 분석 툴(잠재적 위험도 분석 등) (0) | 2012.03.07 |
EDITOR|마크다운(Markdown) (0) | 2012.02.15 |
Comments