|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.poscoict.glueframework.util.mail.GlueSpringMailSender
public class GlueSpringMailSender
GlueSpringMailSender Ŭ·¡½º´Â ½±°Ô SMTP Client¸¦ ±¸ÇöÇÒ ¼ö ÀÖ°Ô ÇÏ´Â ClassÀÌ´Ù. Java Mail ±â¹Ý¿¡¼ SpringÀÇ JavaMailSender¸¦ ÀÌ¿ëÇÏ¿© ±¸ÇöµÇ¾ú´Ù. Áß°è ¸ÞÀÏ ¼¹ö·Î´Â SMTP ¼¹ö¸¦ »ç¿ëÇÑ´Ù. ¸ÞÀÏ ³»¿ëÀº plain text, html ÇüŸ¦ Áö¿øÇϸç euc-kr, utf-8 ÀÎÄÚµùŸÀÔÀ» Áö¿øÇÑ´Ù.
»ç¿ë¿¹) JavaMailSender mailSender = (JavaMailSender) GlueStaticContext.getBeanFactory().getBeanObject( "mailSender" ); GlueSpringMailSender glueMailSender = null; try { glueMailSender = new GlueSpringMailSender(mailSender); } catch ( Exception e1 ) { //¿¡·¯ ó¸® } String from = "º¸³»´Â »ç¶÷ Mail ÁÖ¼Ò"; String to = "¹Þ´Â »ç¶÷ Mail ÁÖ¼Ò"; String subject = "Á¦¸ñ"; String content = "³»¿ë"; String[] file = {"E:\\temp\\test.txt","E:\\temp\\test2.txt"}; try { glueMailSender.setFrom( from ); glueMailSender.setTo( to ); glueMailSender.setText( content ); glueMailSender.addFiles( file ); glueMailSender.sendMail(); } catch ( Exception e ) { //¿¡·¯ ó¸® }
Constructor Summary | |
---|---|
GlueSpringMailSender(org.springframework.mail.javamail.JavaMailSender mailSender)
»ý¼ºÀÚ(constructor). |
|
GlueSpringMailSender(org.springframework.mail.javamail.JavaMailSender mailSender,
boolean multipart)
»ý¼ºÀÚ(constructor). |
|
GlueSpringMailSender(org.springframework.mail.javamail.JavaMailSender mailSender,
boolean multipart,
String encoding)
»ý¼ºÀÚ(constructor). |
Method Summary | |
---|---|
void |
addFile(String filepath)
Message¿¡ ÷ºÎÆÄÀÏ ¼³Á¤ |
void |
addFiles(String[] filepath)
Message¿¡ ÷ºÎÆÄÀÏ ¼³Á¤ |
org.springframework.mail.javamail.MimeMessageHelper |
getMessageHelper()
Spring¿¡¼ Á¦°øÇÏ´Â MimeMessageHelper¸¦ ¹ÝȯÇÑ´Ù. |
void |
sendMail()
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMail(String from,
String[] to,
String subject,
String content)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMail(String from,
String[] to,
String subject,
String content,
String filepath)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMail(String from,
String[] to,
String subject,
String content,
String[] filepath)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMail(String from,
String to,
String subject,
String content)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMail(String from,
String to,
String subject,
String content,
String filepath)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMail(String from,
String to,
String subject,
String content,
String[] filepath)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMailHtml(String from,
String[] to,
String subject,
String content)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMailHtml(String from,
String[] to,
String subject,
String content,
String filepath)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMailHtml(String from,
String[] to,
String subject,
String content,
String[] filepath)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMailHtml(String from,
String to,
String subject,
String content)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMailHtml(String from,
String to,
String subject,
String content,
String filepath)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
sendMailHtml(String from,
String to,
String subject,
String content,
String[] filepath)
¼³Á¤µÈ Message¸¦ Mail·Î º¸³½´Ù. |
void |
setBcc(String bcc)
Message¿¡ BCC ¼³Á¤ |
void |
setBcc(String[] bcc)
Message¿¡ BCC ¼³Á¤ |
void |
setCc(String cc)
Message¿¡ CC ¼³Á¤ |
void |
setCc(String[] cc)
Message¿¡ CC ¼³Á¤ |
void |
setFrom(String from)
Message¿¡ º¸³»´Â »ç¶÷ Mail ÁÖ¼Ò ¼³Á¤ |
void |
setSubject(String subject)
Message¿¡ Á¦¸ñ ¼³Á¤ |
void |
setText(String content)
Message¿¡ º»¹® ¼³Á¤ |
void |
setTextHtml(String content)
Message¿¡ º»¹®(HTMLÇü½Ä) ¼³Á¤ |
void |
setTo(String to)
Message¿¡ ¹Þ´Â »ç¶÷ Mail ÁÖ¼Ò ¼³Á¤ |
void |
setTo(String[] to)
Message¿¡ ¹Þ´Â »ç¶÷ Mail ÁÖ¼Ò ¼³Á¤ |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GlueSpringMailSender(org.springframework.mail.javamail.JavaMailSender mailSender) throws MessagingException
mailSender
- GlueSpringMailSender¸¦ »ç¿ëÇϱâ À§Çؼ´Â SpringÀÇ JavaMailSender°¡ ²À ÇÊ¿äÇÏ´Ù.
MessagingException
public GlueSpringMailSender(org.springframework.mail.javamail.JavaMailSender mailSender, boolean multipart) throws MessagingException
mailSender
- GlueSpringMailSender¸¦ »ç¿ëÇϱâ À§Çؼ´Â SpringÀÇ JavaMailSender°¡ ²À ÇÊ¿äÇÏ´Ù.multipart
- multipart ¿©ºÎ ÆÄÀÏ Ã·ºÎÇÒ °æ¿ì¿¡´Â ¹Ýµå½Ã true·Î ¼³Á¤(Default:true)
MessagingException
public GlueSpringMailSender(org.springframework.mail.javamail.JavaMailSender mailSender, boolean multipart, String encoding) throws MessagingException
mailSender
- GlueSpringMailSender¸¦ »ç¿ëÇϱâ À§Çؼ´Â SpringÀÇ JavaMailSender°¡ ²À ÇÊ¿äÇÏ´Ù.multipart
- multipart ¿©ºÎ ÆÄÀÏ Ã·ºÎÇÒ °æ¿ì¿¡´Â ¹Ýµå½Ã true·Î ¼³Á¤(Default:true)encoding
- encoding ¼³Á¤(Default:UTF-8)
MessagingException
Method Detail |
---|
public org.springframework.mail.javamail.MimeMessageHelper getMessageHelper()
public void sendMail()
public void sendMail(String from, String to, String subject, String content) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®
Exception
public void sendMail(String from, String[] to, String subject, String content) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®
Exception
public void sendMail(String from, String to, String subject, String content, String filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®filepath
- ÷ºÎÆÄÀÏ Path
Exception
public void sendMail(String from, String[] to, String subject, String content, String filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®filepath
- ÷ºÎÆÄÀÏ Path
Exception
public void sendMail(String from, String to, String subject, String content, String[] filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®filepath
- ÷ºÎÆÄÀÏ Path
Exception
public void sendMail(String from, String[] to, String subject, String content, String[] filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®filepath
- ÷ºÎÆÄÀÏ Path
Exception
public void sendMailHtml(String from, String to, String subject, String content) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®(HtmlÇü½Ä)
Exception
public void sendMailHtml(String from, String[] to, String subject, String content) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®(HtmlÇü½Ä)
Exception
public void sendMailHtml(String from, String to, String subject, String content, String filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®(HtmlÇü½Ä)filepath
- ÷ºÎÆÄÀÏ Path
Exception
public void sendMailHtml(String from, String[] to, String subject, String content, String filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®(HtmlÇü½Ä)filepath
- ÷ºÎÆÄÀÏ Path
Exception
public void sendMailHtml(String from, String to, String subject, String content, String[] filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®(HtmlÇü½Ä)filepath
- ÷ºÎÆÄÀÏ Path
Exception
public void sendMailHtml(String from, String[] to, String subject, String content, String[] filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®(HtmlÇü½Ä)filepath
- ÷ºÎÆÄÀÏ Path
Exception
public void setFrom(String from) throws MessagingException
MessagingException
public void setTo(String to) throws MessagingException
MessagingException
public void setTo(String[] to) throws MessagingException
MessagingException
public void setSubject(String subject) throws MessagingException
MessagingException
public void setText(String content) throws MessagingException
MessagingException
public void setTextHtml(String content) throws MessagingException
MessagingException
public void setCc(String cc) throws MessagingException
MessagingException
public void setCc(String[] cc) throws MessagingException
MessagingException
public void setBcc(String bcc) throws MessagingException
MessagingException
public void setBcc(String[] bcc) throws MessagingException
MessagingException
public void addFile(String filepath) throws MessagingException
MessagingException
public void addFiles(String[] filepath) throws MessagingException
MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |