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°¡ ²À ÇÊ¿äÇÏ´Ù.MessagingException
public GlueSpringMailSender(JavaMailSender mailSender, boolean multipart) throws MessagingException
mailSender
- GlueSpringMailSender¸¦ »ç¿ëÇϱâ À§Çؼ´Â SpringÀÇ JavaMailSender°¡ ²À ÇÊ¿äÇÏ´Ù.multipart
- multipart ¿©ºÎ ÆÄÀÏ Ã·ºÎÇÒ °æ¿ì¿¡´Â ¹Ýµå½Ã true·Î ¼³Á¤(Default:true)MessagingException
public GlueSpringMailSender(JavaMailSender mailSender, boolean multipart, String encoding) throws MessagingException
mailSender
- GlueSpringMailSender¸¦ »ç¿ëÇϱâ À§Çؼ´Â SpringÀÇ JavaMailSender°¡ ²À ÇÊ¿äÇÏ´Ù.multipart
- multipart ¿©ºÎ ÆÄÀÏ Ã·ºÎÇÒ °æ¿ì¿¡´Â ¹Ýµå½Ã true·Î ¼³Á¤(Default:true)encoding
- encoding ¼³Á¤(Default:UTF-8)MessagingException
public 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
- ÷ºÎÆÄÀÏ PathException
public void sendMail(String from, String[] to, String subject, String content, String filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®filepath
- ÷ºÎÆÄÀÏ PathException
public void sendMail(String from, String to, String subject, String content, String[] filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®filepath
- ÷ºÎÆÄÀÏ PathException
public void sendMail(String from, String[] to, String subject, String content, String[] filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®filepath
- ÷ºÎÆÄÀÏ PathException
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
- ÷ºÎÆÄÀÏ PathException
public void sendMailHtml(String from, String[] to, String subject, String content, String filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®(HtmlÇü½Ä)filepath
- ÷ºÎÆÄÀÏ PathException
public void sendMailHtml(String from, String to, String subject, String content, String[] filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®(HtmlÇü½Ä)filepath
- ÷ºÎÆÄÀÏ PathException
public void sendMailHtml(String from, String[] to, String subject, String content, String[] filepath) throws Exception
from
- º¸³»´Â »ç¶÷ Mail ÁÖ¼Òto
- ¹Þ´Â »ç¶÷ Mail ÁÖ¼Òsubject
- Á¦¸ñcontent
- º»¹®(HtmlÇü½Ä)filepath
- ÷ºÎÆÄÀÏ PathException
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
Copyright © 2013–2016 POSCO ICT. All rights reserved.