I am trying to send emails from my Spring applcation using JavaMailSenderImpl with a Google App mail configured for my domain.
Here is the configuration
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="smtp.gmail.com" />
<property name="username" value="${app.mail.id}" />
<property name="password" value="${app.mail.password}" />
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
</props>
</property>
</bean>
with my email id as myid@mydomain.com. There are no exceptions thrown and I can find these mails in the sent items. But these mails are never delivered. Anyone with any idea on why would this happen? Any help would be greatly appreciated.
Btw it was working fine when I was using app.mail.id = myid@gmail.com instead of myid@mydomain.com. And these mails get delivered if I send it directly from the mailbox.
Solved. I think the problem was that the changes in the MX records didn’t get reflected. Now its working fine.