
public class GlueSpringMailSender extends Object
»ç¿ë¿¹) 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 and Description |
|---|
GlueSpringMailSender(JavaMailSender mailSender)
»ý¼ºÀÚ(constructor).
|
GlueSpringMailSender(JavaMailSender mailSender,
boolean multipart)
»ý¼ºÀÚ(constructor).
|
GlueSpringMailSender(JavaMailSender mailSender,
boolean multipart,
String encoding)
»ý¼ºÀÚ(constructor).
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(String filepath)
Message¿¡ ÷ºÎÆÄÀÏ ¼³Á¤
|
void |
addFiles(String[] filepath)
Message¿¡ ÷ºÎÆÄÀÏ ¼³Á¤
|
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 ÁÖ¼Ò ¼³Á¤
|
public GlueSpringMailSender(JavaMailSender mailSender) throws MessagingException
mailSender - GlueSpringMailSender¸¦ »ç¿ëÇϱâ À§Çؼ´Â SpringÀÇ JavaMailSender°¡ ²À ÇÊ¿äÇÏ´Ù.MessagingExceptionpublic GlueSpringMailSender(JavaMailSender mailSender, boolean multipart) throws MessagingException
mailSender - GlueSpringMailSender¸¦ »ç¿ëÇϱâ À§Çؼ´Â SpringÀÇ JavaMailSender°¡ ²À ÇÊ¿äÇÏ´Ù.multipart - multipart ¿©ºÎ ÆÄÀÏ Ã·ºÎÇÒ °æ¿ì¿¡´Â ¹Ýµå½Ã true·Î ¼³Á¤(Default:true)MessagingExceptionpublic GlueSpringMailSender(JavaMailSender mailSender, boolean multipart, String encoding) throws MessagingException
mailSender - GlueSpringMailSender¸¦ »ç¿ëÇϱâ À§Çؼ´Â SpringÀÇ JavaMailSender°¡ ²À ÇÊ¿äÇÏ´Ù.multipart - multipart ¿©ºÎ ÆÄÀÏ Ã·ºÎÇÒ °æ¿ì¿¡´Â ¹Ýµå½Ã true·Î ¼³Á¤(Default:true)encoding - encoding ¼³Á¤(Default:UTF-8)MessagingExceptionpublic MimeMessageHelper getMessageHelper()
public void sendMail()
public void sendMail(String from, String to, String subject, String content) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®Exceptionpublic void sendMail(String from, String[] to, String subject, String content) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®Exceptionpublic void sendMail(String from, String to, String subject, String content, String filepath) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®filepath - ÷ºÎÆÄÀÏ PathExceptionpublic void sendMail(String from, String[] to, String subject, String content, String filepath) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®filepath - ÷ºÎÆÄÀÏ PathExceptionpublic void sendMail(String from, String to, String subject, String content, String[] filepath) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®filepath - ÷ºÎÆÄÀÏ PathExceptionpublic void sendMail(String from, String[] to, String subject, String content, String[] filepath) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®filepath - ÷ºÎÆÄÀÏ PathExceptionpublic void sendMailHtml(String from, String to, String subject, String content) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®(HtmlÇü½Ä)Exceptionpublic void sendMailHtml(String from, String[] to, String subject, String content) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®(HtmlÇü½Ä)Exceptionpublic void sendMailHtml(String from, String to, String subject, String content, String filepath) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®(HtmlÇü½Ä)filepath - ÷ºÎÆÄÀÏ PathExceptionpublic void sendMailHtml(String from, String[] to, String subject, String content, String filepath) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®(HtmlÇü½Ä)filepath - ÷ºÎÆÄÀÏ PathExceptionpublic void sendMailHtml(String from, String to, String subject, String content, String[] filepath) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®(HtmlÇü½Ä)filepath - ÷ºÎÆÄÀÏ PathExceptionpublic void sendMailHtml(String from, String[] to, String subject, String content, String[] filepath) throws Exception
from - º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto - ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject - Á¦¸ñcontent - º»¹®(HtmlÇü½Ä)filepath - ÷ºÎÆÄÀÏ PathExceptionpublic void setFrom(String from) throws MessagingException
MessagingExceptionpublic void setTo(String to) throws MessagingException
MessagingExceptionpublic void setTo(String[] to) throws MessagingException
MessagingExceptionpublic void setSubject(String subject) throws MessagingException
MessagingExceptionpublic void setText(String content) throws MessagingException
MessagingExceptionpublic void setTextHtml(String content) throws MessagingException
MessagingExceptionpublic void setCc(String cc) throws MessagingException
MessagingExceptionpublic void setCc(String[] cc) throws MessagingException
MessagingExceptionpublic void setBcc(String bcc) throws MessagingException
MessagingExceptionpublic void setBcc(String[] bcc) throws MessagingException
MessagingExceptionpublic void addFile(String filepath) throws MessagingException
MessagingExceptionpublic void addFiles(String[] filepath) throws MessagingException
MessagingExceptionCopyright © 2013–2016 POSCO ICT. All rights reserved.