So that means you don't have an SMTP server running on your machine. Talk to
you sys admin on setting it up or google on how to do it. Its a bad idea to
silently swallow exceptions.
Sanjiv
On 7/3/07, Msarda <[EMAIL PROTECTED]> wrote:
When i uncommented the line,i was getting error like..
org.springframework.mail.MailSendException; nested exceptions (0) are:
Caused by: javax.mail.MessagingException: Could not connect to SMTP host:
localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
I have enterd following in my dispatcher-servlet.xml
<bean id="mailSender"
class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host"><value>localhost</value></property>
</bean>
Sanjiv Jivan wrote:
>
> Whats the configuration of your 'mailSender' bean. Have you confirmed
that
> its pointing to a valid SMTP server? Also if you uncomment the line
where
> you're swallowing the exception you'll have a better idea of what the
> problem is.
>
> } catch (MailException ex) {
> //log.error(ex.getMessage());
> }
>
>
> Sanjiv
>
> On 7/2/07, Msarda <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi all,
>>
>> I am implementing send email functionality in my spring application.I
>> have
>> created a class that implements this functionality.Following is the
code
>> of
>> that method..
>>
>> public Long sendEmailNotification(String name,String title,String
>> emailID)
>> throws NamingException, SQLException
>> {
>>
>> Long RequestID=getRequestID(name,title,emailID);
>> try {
>> SimpleMailMessage msg = new SimpleMailMessage(
>> this.message);
>> msg.setTo("[EMAIL PROTECTED]");
>> msg.setText("Request has been submitted for request id
"
>> +
>> RequestID.toString() );
>> System.out.println(RequestID.toString());
>> mailSender.send(msg);
>>
>> } catch (MailException ex) {
>> //log.error(ex.getMessage());
>> }
>> return RequestID;
>> }
>>
>> I have set from and subject properties for mail message in
>> dispatcher-servlet.xml.
>> This method is getting executed successfully.But no mail is sent.
>> Do i need to do something more....SMTP server related part...
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Email-Generation-tf4015956s2369.html#a11405432
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Email-Generation-tf4015956s2369.html#a11406187
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]