I know this might be a silly question; I followed the document "email configuration" and try to setup a smtp sender on gmail but just get "Read time out" exception
Here is my configuration:
Code: Select all
<bean id="blMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host"><value>smtp.gmail.com</value></property>
<property name="port"><value>465</value></property>
<property name="protocol"><value>smtp</value></property>
<property name="username"><value>myemail@gmail.com</value></property>
<property name="password"><value>mypassword</value></property>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.starttls.enable">true</prop>
<prop key="mail.smtp.timeout">25000</prop>
<prop key="mail.smtp.auth">true</prop>
</props>
</property>
</bean>
and got this exception
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Exception reading response;
[artifact:mvn] nested exception is:
[artifact:mvn] java.net.SocketTimeoutException: Read timed out. Failed messages: javax.mail.MessagingException: Exception reading response;
[artifact:mvn] nested exception is:
[artifact:mvn] java.net.SocketTimeoutException: Read timed out; message exception details (1) are:
[artifact:mvn] Failed message 1:
[artifact:mvn] javax.mail.MessagingException: Exception reading response;
[artifact:mvn] nested exception is:
[artifact:mvn] java.net.SocketTimeoutException: Read timed out
[artifact:mvn] at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1611)
[artifact:mvn] at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369)
[artifact:mvn] at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
[artifact:mvn] at javax.mail.Service.connect(Service.java:288)
I am not familiar with smtp service; do you think I should setup my own smtp? I heard that if you use your own smtp, the email you sent might be rejected by the major email service providers - they might see your mail as spam, is this true?
If possible, would you provide some hints like what shall I search on google for setting a stable smtp service for the estore?
Links are more appreciated.
Thank you guys!
Dan