Page 1 of 1

How to configure email sender?

Posted: Thu Aug 21, 2014 2:17 pm
by daniel_locious
Hi guys,

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

Re: How to configure email sender?

Posted: Fri Aug 22, 2014 9:42 am
by phillipuniverse
Yes, if you just use an SMTP service that you set up on some Linux server somewhere it is likely to fall into spam.

What you should search for is transactional email services. We have used Mandrill in the past (which is built by Mailchimp). Mailgun is another transactional service that we have not used but have heard good things about. Both services have done the legwork to ensure that emails that you send actually get delivered.