
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–2021 POSCO ICT. All rights reserved.