EJB(xml/mail/jms/jdbc)
2015.06.16 / 23:51

5½Ã°£¿¡ °ÉÃÄ ¸ÞÀÏÀü¼Û È®ÀÎµÈ ´Ù¼¸ °³ÀÇ ÁÖ¿ä Æ÷ÅÐÀÇ SMTP¼­¹ö µµ¸ÞÀΰú Æ÷Æ®,

¸Þ¸®¾ß½º
Ãßõ ¼ö 207

½Ã°£¿¡ °ÉÃÄ ¸ÞÀÏÀü¼Û È®ÀεȠ´Ù¼¸ °³ÀÇ ÁÖ¿ä Æ÷ÅÐÀÇ SMTP¼­¹ö µµ¸ÞÀΰú Æ÷Æ®,

      ±×¸®°í SSL/TLS º¸¾È ¿¬°á¿¡ µû¸¥ °¢±â ´Ù¸¥ Properties¼³Á¤ °ª Á¶»ç ¿Ï·á..

 

  • ±¸±Û G-mail    >    smtp.gmail.com / 465 / TLS
  • ³×ÀÌÆ® ¸ÞÀÏ nate      >     smtp.mail.nate.com / 465 / SSL
  • ´ÙÀ½ ÇѸÞÀÏ hanmail     >    smtp.daum.net / 465 / SSL
  • ³×À̹ö ¸ÞÀÏ naver      >     dsmtp.naver.com / 465 / SSL
  • ¾Æ¿ô·è ÇÖ¸ÞÀÏ hotmail     >    smtp-mail.outlook.com / 587 / TLS

 

 

 

Google gmaill IMAP ¼³Á¤ Á¤º¸

  

// ±¸±Û Gmail SMTP »ç¿ë½Ã

  Properties props = new Properties();
  
   props.put("mail.transport.protocol", "smtp");
   props.put("mail.smtp.host", "smtp.gmail.com");
   props.put("mail.smtp.port", "465");
   props.put("mail.smtp.starttls.enable","true");
   props.setProperty("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");
   props.put("mail.smtp.auth", "true");
       
   Authenticator auth = new SMTPAuthenticator();
   Session mailSession = Session.getDefaultInstance(props, auth);

===============================================================================================

 

 

 

³×À̹ö ¸ÞÀÏ IMAP ¼³Á¤ Á¤º¸
  

// ³×À̹ö SMTP »ç¿ë½Ã
   Properties props = new Properties();
  
   props.put("mail.transport.protocol", "smtp");
   props.put("mail.smtp.host", "smtp.naver.com");
   props.put("mail.smtp.port", "587");
   props.put("mail.smtp.starttls.enable","true");
   props.put("mail.smtp.ssl.trust", "smtp.naver.com");
   props.put("mail.smtp.auth", "true");
  
   Authenticator auth = new SMTPAuthenticator();
   Session mailSession = Session.getDefaultInstance(props, auth);

===============================================================================================

 

 

 

³×ÀÌÆ® ¸ÞÀÏ IMAP ¼³Á¤ Á¤º¸
 

// ³×ÀÌÆ® SMTP »ç¿ë½Ã

  Properties props = new Properties();
 
  props.put("mail.transport.protocol", "smtp");
  props.put("mail.smtp.host", "smtp.mail.nate.com");
  props.put("mail.smtp.port", "465");
  props.put("mail.smtp.ssl.enable", "true");
  props.put("mail.smtp.auth", "true");

 

  Authenticator auth = new SMTPAuthenticator();
  Session mailSession = Session.getDefaultInstance(props, auth);

===============================================================================================

 

 

 

´ÙÀ½ ÇѸÞÀÏ IMAP ¼³Á¤ Á¤º¸

// ´ÙÀ½ ÇѸÞÀÏ SMTP »ç¿ë½Ã

  Properties props = new Properties();
 
  props.put("mail.transport.protocol", "smtp");
  props.put("mail.smtp.host", "smtp.daum.net");
  props.put("mail.smtp.port", "465");
  props.put("mail.smtp.ssl.enable", "true");
  props.put("mail.smtp.auth", "true");

 

  Authenticator auth = new SMTPAuthenticator();
  Session mailSession = Session.getDefaultInstance(props, auth);
 ===============================================================================================

 

¾Æ¿ô·è ÇÖ¸ÞÀÏ IMAP ¼³Á¤ Á¤º¸

// Outlook ÇÖ¸ÞÀÏ SMTP »ç¿ë½Ã
  Properties props = new Properties();
 
  props.put("mail.transport.protocol", "smtp");
  props.put("mail.smtp.host", "smtp-mail.outlook.com");
  props.put("mail.smtp.port", "587");
  props.put("mail.smtp.starttls.enable","true");
  props.put("mail.smtp.auth", "true");

 

  Authenticator auth = new SMTPAuthenticator();
  Session mailSession = Session.getDefaultInstance(props, auth);

 ===============================================================================================

 

 

com.sun.mail.smtp (properties API): https://javamail.java.net/nonav/docs/api/com/sun/mail/smtp/package-summary.html

 

ÀÚ¹Ù ¸ÞÀÏ(javamail) API: https://javamail.java.net/nonav/docs/api/

 

Content¸¦ HTML·Î ¼³Á¤ÇÏ´Â ¹æ¹ý: http://www.codejava.net/java-ee/javamail/send-e-mail-in-html-format-using-javamail-api

 

ÀÎÁõ ½ÇÆпÀ·ù ÄÚµå ¸ðÀ½: http://blog.daum.net/seee50/15859312 

 

³×À̹ö Works´Â º°°³ÀÇ SMTP¸¦ »ç¿ë: :http://help.naver.com/ops/step2/faq.nhn?faqId=26137

 

==================================================================================================

 

 

SMTP ERROR: Password command failed: 534-5.7.14 ¿¡·¯ ¹ß»ý½Ã


To fix this issue, you need to:

1) Login to your Gmail account using the web browser
2) Click on this link to enable applications to access your account:
https://accounts.google.com/b/0/DisplayUnlockCaptcha
3) Click on Continue button to complete the step
4) Now try again to send the email from your PHP script

View a list of recently allowed applications: