# Email failed to deliver

**URL:** <https://community.mosip.io/t/email-failed-to-deliver/493>\
**Category:** General\
**Tags:** pre-registration\
**Created:** [May 20, 2023, 9:59am UTC](https://community.mosip.io/t/email-failed-to-deliver/493 "2023-05-20T09:59:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayant](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Jayant](https://community.mosip.io/u/Jayant)\
**Post date:** [May 20, 2023, 9:59am UTC](https://community.mosip.io/t/email-failed-to-deliver/493/1 "2023-05-20T09:59:46Z")

</div>

Hi Team,

We are facing issue while email trigger , Below are the logs Please help to resolve this  
we are already map TLS email-smtp-host: [smtp.gmail.com](http://smtp.gmail.com), email-smtp-port: “587”  
Kernel Version: kernel-notification-service:1.2.0.1-B1

2023-05-19 12:49:15,381 [http-nio-8083-exec-4] INFO [i.m.k.a.d.h.ValidateTokenHelper].buildMosipUser.274 : user (offline verification done): service-account-mosip-prereg-client  
2023-05-19 12:49:15,385 [http-nio-8083-exec-4] INFO [i.m.k.e.s.i.EmailNotificationServiceImpl].sendEmail.77 : To Request : [demokenya1111@gmail.com](mailto:demokenya1111@gmail.com)  
{“@timestamp”:“2023-05-19T12:49:15.388Z”,“level”:“ACCESS”,“level\_value”:70000,“traceId”:“51f540bdc359d3b2dff5f112fc0f9443”,“statusCode”:200,“req.requestURI”:“/v1/notifier/email/send”,“bytesSent”:166,“timeTaken”:0.014,“appName”:“kernel-notification-service”,“req.userAgent”:“Apache-HttpClient/4.5.6 (Java/11.0.16)”,“req.xForwardedFor”:“-”,“req.referer”:“-”,“req.method”:“POST”,“req.remoteHost”:“127.0.0.6”}  
2023-05-19 12:49:16,841 [SimpleAsyncTaskExecutor-2] ERROR [i.m.k.l.l.i.Slf4jLoggerImpl].error.27 : - ERROR-CODE -

- Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. de14-20020a1709069bce00b00965ddf2e221sm2273708ejc.93 - gsmtp

---

<div class="post-metadata">

**Author:** ![gsasikumar](https://avatars.discourse-cdn.com/v4/letter/g/b782af/32.png) [@gsasikumar](https://community.mosip.io/u/gsasikumar)\
**Post date:** [May 31, 2023, 7:30am UTC](https://community.mosip.io/t/email-failed-to-deliver/493/2 "2023-05-31T07:30:52Z")

</div>

Hi Jayanth,

We use the Spring JavaMailSender. You can configure the following.

```auto
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=<login user to smtp server>
spring.mail.password=<login password to smtp server>
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true

```

The above is referred from

> **[Guide to Spring Email | Baeldung](https://www.baeldung.com/spring-email)**
>
> In this article, we'll walk through the steps needed to send emails from both a plain vanilla Spring application as well as from a Spring Boot application.

---

<div class="post-metadata">

**Author:** ![panharith2023](https://dub1.discourse-cdn.com/flex017/user_avatar/community.mosip.io/panharith2023/32/580_2.png) [@panharith2023](https://community.mosip.io/u/panharith2023)\
**Post date:** [September 13, 2023, 7:51am UTC](https://community.mosip.io/t/email-failed-to-deliver/493/3 "2023-09-13T07:51:29Z")

</div>

According to MOSIP java code, we need to set, in a file in config-server repository “mosip-config/kernel-default.properties”, **mosip.kernel.mail.proxy-mail to false** to trigger the sendMail function.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/mosip1/original/1X/7639f37878f5a1c9895a38de578b909492100cf6.jpeg)

Solution: in file kernel-default.properties in config-sever repository:

`mosip.kernel.mail.proxy-mail=false`

and then , in Rancher UI or using helm command, redeploy Config-Server pod (namespace config-server) & Notifier pod (namespace kernel).  
Link to Java code: [https://github.com/mosip/commons/blob/b04faa5b68be555d7e48fada48faa596df4b5a82/kernel/kernel-notification-service/src/main/java/io/mosip/kernel/emailnotification/service/impl/EmailNotificationServiceImpl.java#L52](https://github.com/mosip/commons/blob/b04faa5b68be555d7e48fada48faa596df4b5a82/kernel/kernel-notification-service/src/main/java/io/mosip/kernel/emailnotification/service/impl/EmailNotificationServiceImpl.java#L52)

---

<div class="post-metadata">

**Author:** ![sanchi-singh24](https://dub1.discourse-cdn.com/flex017/user_avatar/community.mosip.io/sanchi-singh24/32/538_2.png) [@sanchi-singh24](https://community.mosip.io/u/sanchi-singh24)\
**Post date:** [September 13, 2023, 7:55pm UTC](https://community.mosip.io/t/email-failed-to-deliver/493/4 "2023-09-13T19:55:24Z")

</div>

Hi @panharith2023

If you need any support you can reach out to us in the same thread or initiate a new one.

Best Regards,  
Team MOSIP

---

<div class="post-metadata">

**Author:** ![sanchi-singh24](https://dub1.discourse-cdn.com/flex017/user_avatar/community.mosip.io/sanchi-singh24/32/538_2.png) [@sanchi-singh24](https://community.mosip.io/u/sanchi-singh24)\
**Post date:** [October 11, 2023, 11:00am UTC](https://community.mosip.io/t/email-failed-to-deliver/493/5 "2023-10-11T11:00:00Z")

</div>

Closed on October 11, 2023, 11:00am UTC


