Thanks Matt, Injecting the MailEngine dependency into my class did the trick. I was surprised I needed to, thought I could achieve same by obtaining the mailEngine bean from code. But now it works and I understand dependency injection better too.
And I had to fiddle with sender/ account settings to avoid "sender DNS..." errors but that was down to my settings / ISP. mraible wrote: > > Have you injected the MailEngine dependency into your class? Does this > issue happen in an AppFuse class or one of yours? If it's yours, can > you please post the code where you inject the dependency (and your > bean definition)? > > Thanks, > > Matt > > On 8/6/07, mikebgx <[EMAIL PROTECTED]> wrote: >> >> I'm using version 1.9.4 of AppFuse >> >> In the send(SimpleMailMessage) method of the service/MailEngine.java >> class, >> I noticed that MailEngine's mailSender variable was null so as a >> test/bodge >> I added mailSender= new JavaMailSenderImpl() >> which clearly upsets things as its not using the params in >> applicationContext-service.xml. >> >> So my underlying problem is that service/MailEngine.mailSender is null, >> somehow its not being instantiated (with the >> applicationContext-service.xml. >> params) >> >> >> >> mraible wrote: >> > >> > What version of AppFuse are you using? >> > >> > Matt >> > >> > On 8/4/07, mikebgx <[EMAIL PROTECTED]> wrote: >> >> >> >> I'm trying to send email from my Appfuse/JSF/Hibernate app and get >> this >> >> exception: >> >> >> >> MailEngine.send(75) | Mail server connection failed; nested exception >> is >> >> javax.mail.MessagingException: >> >> Could not connect to SMTP host: localhost, port: 25; >> >> >> >> It seems to think my mailserver details are localhost..., how can I >> >> change >> >> this? >> >> >> >> I've tried editing mail.properties as follows: (the mail a/c works >> btw, >> >> I've >> >> tested it in Mozilla Thunderbird) >> >> >> >> mail.default.from=PIL <[EMAIL PROTECTED]> >> >> mail.debug=false >> >> mail.transport.protocol=smtp >> >> mail.host=auth.smtp.onendone.co.uk >> >> [EMAIL PROTECTED] >> >> mail.password=pilpilpil >> >> >> >> >> >> I've also tried editing applicationContext-service.xml as follows: >> >> >> >> <bean id="mailSender" >> >> class="org.springframework.mail.javamail.JavaMailSenderImpl"> >> >> <property name="host" value="auth.smtp.1and1.co.uk"/> >> >> <property name="username" value="[EMAIL PROTECTED]"/> >> >> <property name="password" value="pilpilpil"/> >> >> <property name="javaMailProperties"> >> >> <value> >> >> mail.smtp.auth=true >> >> </value> >> >> </property> >> >> </bean> >> >> >> >> Here's the .java: >> >> String emailTo= "[EMAIL PROTECTED]"; >> >> String msg= "Calibre test email"; >> >> MailEngine mailEngine= new MailEngine(); >> >> SimpleMailMessage message= new SimpleMailMessage(); >> >> message.setTo(emailTo+ "<"+ emailTo + ">"); >> >> mailEngine.send(message); >> >> >> >> Rgds, Mike >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/trying-to-send-email-tf4217379s2369.html#a11998228 >> >> Sent from the AppFuse - User mailing list archive at Nabble.com. >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> > >> > >> > -- >> > http://raibledesigns.com >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/trying-to-send-email-tf4217379s2369.html#a12013537 >> >> Sent from the AppFuse - User mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > http://raibledesigns.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/trying-to-send-email-tf4217379s2369.html#a12057413 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]