我使用速度enguine和Java邮件服务来发送邮件。我使用SMTP protocal ..这里是我为得到错误“无法找到有效的认证路径要求的目标”用java邮件服务时使用Velocity引擎
豆ID配置= “mailSender” 级= “org.springframework.mail.javamail.JavaMailSenderImpl”/
property name="host" value="lotus.acme.com"/
property name="port" value="25"/
property name="username" value="edosrvc"/
property name="password" value="[email protected]"/
property name="javaMailProperties"
props
<!-- Use SMTP transport protocol -->
prop key="mail.transport.protocol">smtp</prop>
<!-- Use SMTP-AUTH to authenticate to SMTP server -->
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.ssl.trust">*</prop>
<!-- Use TLS to encrypt communication with SMTP server -->
<prop key="mail.smtp.starttls.enable">true</prop>
<prop key="mail.debug">true</prop>
</props>
</property>
</bean>
<bean id="esi" class="com.example.NotificationServiceImpl">
<property name="mailSender" ref="mailSender" />
<property name="velocityEngine" ref="velocityEngine" />
</bean>
<bean id="velocityEngine"class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="velocityProperties">
<value>
resource.loader=class
class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
</value>
</property>
</bean>
<bean id="templateMessage" class="org.springframework.mail.SimpleMailMessage">
<property name="from" value="[email protected]"></property>
</bean>
我有尝试包括这个属性也
*
即使这样,我得到贝卢错误
sun.security.provider.certpath.SunCertPathBuilderException:无法在sun.security.provider.certpath.SunCertPathBuilder.engineBuild找到有效的认证路径要求的目标 (SunCertPathBuilder。 java:174) at sun.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:280) at sun.security.validator.PKIXValidator。 engineValidate(PKIXValidator.java:191) at sun.security.validator.Validator.validate(Validator.java:218)
任何人都可以请帮我解决这个问题。
我很新的这protocals和服务器证书。
所以任何一个可以请告诉我如何让我的工作很快就完成。
在此先感谢。