Menu

Home

Dave Brondsema shin.y.s.
Attachments
example.png (12479 bytes)

Welcome to 썬더메일 커넥터 wiki!

  1. 개요 : 메일 대량 발송 솔루션인 썬더메일5.0 ( http://www.thundermail.co.kr/thundermail/ )을 통한 메일발송 라이브러리. 썬더메일을 통한 메일 발송 기능 클래스 본 메일발송 클래스는 1 ~ 수십명 단위의 메일 발송에는 적합하나 수 백 단위 이상의 대량 메일에는 적합하지 않음.
    한번에 500인 이상 설정 시 exception throw하도록 구현 함. 대량발송 메일이 필요한 경우에는 본 API보다는 반드시 썬더메일의 대량 메일발송 기능을 직접 이용하도록한다.

  2. 의존성 : httpclient-4.1.X.jar httpcore-4.1.X.jar commons-logging-1.X.X.jar

  3. 사용법 :
    썬더메일 라이브러리가 의존관계에있는 httpclient-4.1.X.jar httpcore-4.1.X.jar commons-logging-1.X.X.jar 는 jakarta-commons 프로젝트 홈에서 다운로드한다.

code 예제

다음과 같이 [$joinDate] [$userName] [$newPassword] 세개의 치환자를 갖는 템플릿을 썬더메일 솔루션에 등록했다고 가정하면
alternate text

code를 통해 다음과 같이 치환자를 설정 할 수 있다.

import sys.ThunderMailConnector;   
import sys.MailReciver;
//1. ThunderMailConnector   생성 
//생성시 인자로 메일 템플릿 고유번호(필수항목)  인자로 건네야함. 
//템플릿 고유번호 없을  썬더메일 관리자를 통하여 자동 메일 템플릿 등록이 선행되어야 .
ThunderMailConnector   connector = new ThunderMailConnector  ( "http://thunder-mail-api-url" , "4" );

//2. connector 인스턴스에 메일발송을 위한 기본 데이터를 세팅한다. 
connector.setMailTitle( "메일 제목입니다." ); 
//connector.setMailTitle( "[$user_name]" );  같이 썬더메일 치환문자열을 사용할  있다.
connector.setSenderEmail( "noreply@company.com" );   
connector.setSenderName( "메일 발송인명" ); 

//3. addReciver(MailReciver  reciver) 메소드를 통하여 썬더메일에 전달할 데이터키-데이터값을 세팅한다.    
MailReciver  reciver = new MailReciver();   
reciver.setReciverMailAddress(" shiny@company.com");   
reciver.setReciverName("신윤섭");


//썬더메일에 전달하여 치환자에 바인딩할 데이터키-데이터값을 세팅한다.
Map<String,String> dataMap = new HashMap<String,String>();    
dataMap.put( "joinDate" , "2009년 07월 09일" ); //메일 템플릿의 [$joinDate] "2009년 07월 09일"으로 치환 
dataMap.put( "userName" , "신윤섭"); //메일 템플릿의 [$userName]  "신윤섭" 치환 
dataMap.put( "newPassword" , "234#$Xd"); //메일 템플릿의 [$newPassword]  "234#$Xd" 치환

//썬더메일 템플릿의 치환자를 대치할 데이터 세팅 
reciver.setMailData(dataMap); 


//addReciver() 통해 메일 수신인 만큼의 reciver를 add. 한번에 500 이상 등록시 exception을 throw함.
connector.addReciver( reciver );  

//4. send() 메소드를 통하여 썬더메일에게 해당 템플릿의 메일 발송을 요청한다. 
connector.send();

This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].

The wiki uses Markdown syntax.

Project Members:


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.