-1

I'm trying to send mail using java in my web project.E-mail sending is perfectly working in my pc, but when I run it on my office computer,I received following error.

In my applicationcontext.xml

    </bean>
    <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    <property name="host" value="smtp.gmail.com" />
    <property name="port" value="587" />
    <property name="username" value="myemail@gmail.com" />
    <property name="password" value="****" />
    <property name="javaMailProperties">
        <props>
            <prop key="mail.transport.protocol">smtp</prop>
            <prop key="mail.smtp.auth">true</prop>
            <prop key="mail.smtp.starttls.enable">true</prop>
        </props>
    </property>
</bean>

Pls guide me to solve this issue.Thanks

chk.buddi
  • 554
  • 1
  • 8
  • 29

1 Answers1

0

Considering the location perspective, you can first check if your office firewall is allowing you to connect to the target location using the smtp protocol.

For the java perspective, check if your office PC are running at the same java version, binaries and build similar to you home PC.

Jose
  • 66
  • 5