Message Boards
Threads [ Previous | Next ]
SMTP Relay
SMTP Relay Jim garcia 10/22/08 12:47 PM
RE: SMTP Relay Heflin Hogan 10/23/08 10:16 AM
RE: SMTP Relay Heflin Hogan 10/23/08 11:45 AM
RE: SMTP Relay Jim garcia 10/23/08 12:17 PM
RE: SMTP Relay Heflin Hogan 10/23/08 12:40 PM
SMTP Relay
10/22/08 12:47 PM
I am trying to configure the smtp email for my project. I am getting

553 sorry, that domain isn't in my list of allowed rcpthosts

My email requires authentication. I tried to add:

<property name="username"><value>test@test.com</value></property>
<property name="password"><value>testtestpassword</value></property>


To the
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
tag in infrastructure-server-context.xml

The values got over written when I saved the project.

Any Ideas.

Jim
RE: SMTP Relay
10/23/08 10:16 AM as a reply to Jim garcia.
Jim,

Adding a spring config file to the service layer with the bean id of "mailSender" might override the default settings, but I haven't tested that out yet. I'll get that verified, but you can try it out if you want.
RE: SMTP Relay
10/23/08 11:45 AM as a reply to Heflin Hogan.
I dropped a spring config file called mailtest.xml into my resources folder with a single bean id of "mailSender" and pointed to a different host than what was already in the general settings on the Spring Configuration tab for the project. I then added the new file to the list of spring XML files to be loaded with the service layer on that same tab. When I ran my project, the mail went to the override server.

So, in short, it works.
RE: SMTP Relay
10/23/08 12:17 PM as a reply to Heflin Hogan.
I am getting an error that it can't find the bean.

Cannot find the declaration of element 'bean'.

Can you attach a sample of the xml file you used?

Thanks

Jim
RE: SMTP Relay
10/23/08 12:40 PM as a reply to Jim garcia.
Sure:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">



<!-- ******************************************************************** -->
<!-- Setup a mail sender -->
<!-- ******************************************************************** -->
<bean id="mailSender"
class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="sandbox" />
</bean>

</beans>

That's my complete file.
© Copyright 2001-2010 Skyway Software Inc. All Rights Reserved