diff --git a/backend/src/main/java/org/ftclub/cabinet/config/GmailProperties.java b/backend/src/main/java/org/ftclub/cabinet/config/GmailProperties.java index 3cdb9b405..51b22f28d 100644 --- a/backend/src/main/java/org/ftclub/cabinet/config/GmailProperties.java +++ b/backend/src/main/java/org/ftclub/cabinet/config/GmailProperties.java @@ -17,6 +17,9 @@ public class GmailProperties { @Value("${spring.mail.port}") private int mailServerPort; + @Value("${spring.mail.display-sender-name}") + private String displaySenderName; + @Value("${spring.mail.username}") private String username; diff --git a/backend/src/main/java/org/ftclub/cabinet/utils/mail/EmailSender.java b/backend/src/main/java/org/ftclub/cabinet/utils/mail/EmailSender.java index 116cb0acd..289656cd2 100644 --- a/backend/src/main/java/org/ftclub/cabinet/utils/mail/EmailSender.java +++ b/backend/src/main/java/org/ftclub/cabinet/utils/mail/EmailSender.java @@ -31,7 +31,7 @@ public void sendMail(String name, String to, String subject, String template) MimeMessage message = javaMailSender.createMimeMessage(); MimeMessageHelper helper = new MimeMessageHelper(message, true, "UTF-8"); - helper.setFrom(gmailProperties.getUsername()); + helper.setFrom(gmailProperties.getDisplaySenderName() + " <" + gmailProperties.getUsername() + ">"); helper.setTo(to); helper.setSubject(subject); diff --git a/backend/src/test/resources/application.yml b/backend/src/test/resources/application.yml index 8deafde45..fa3165899 100644 --- a/backend/src/test/resources/application.yml +++ b/backend/src/test/resources/application.yml @@ -56,6 +56,7 @@ spring: no-risk-of-blackhole: 0 42 1 1 * * # 매월 1일 1시 42분 0초 mail: + display-sender-name: "42CABI" soonoverdue: term: -1 subject: "42CABI 사물함 연체 예정 알림"