Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 53439 invoked from network); 16 Jun 2006 06:11:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jun 2006 06:11:44 -0000 Received: (qmail 44728 invoked by uid 500); 16 Jun 2006 06:11:26 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 44677 invoked by uid 500); 16 Jun 2006 06:11:25 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 44648 invoked by uid 99); 16 Jun 2006 06:11:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jun 2006 23:11:25 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=HTML_MESSAGE,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [216.82.249.163] (HELO mail43.messagelabs.com) (216.82.249.163) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 15 Jun 2006 23:11:23 -0700 X-VirusChecked: Checked X-Env-Sender: Sunil_Sahu@Keane.com X-Msg-Ref: server-2.tower-43.messagelabs.com!1150438234!24859272!1 X-StarScan-Version: 5.5.10.7; banners=-,-,- X-Originating-IP: [63.117.221.150] Received: (qmail 6046 invoked from network); 16 Jun 2006 06:10:35 -0000 Received: from unknown (HELO messaging13.keane.com) (63.117.221.150) by server-2.tower-43.messagelabs.com with SMTP; 16 Jun 2006 06:10:35 -0000 In-Reply-To: <617C253B053C1B44A0685CA0685CF5F602B676D5@USNCEX07.ad.diebold.com> To: "Struts Users Mailing List" Cc: patils1@diebold.com Subject: Re: urgent- exception in sending e-mail from application MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5.3 September 14, 2004 Message-ID: From: Sunil_Sahu@Keane.com Date: Fri, 16 Jun 2006 11:48:01 +0530 X-MIMETrack: Serialize by Router on SMTP1/Keane(653FP1HF82|March 11, 2005) at 06/16/2006 02:10:32 AM, Serialize complete at 06/16/2006 02:10:32 AM Content-Type: multipart/alternative; boundary="=_alternative 00224CB26525718F_=" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --=_alternative 00224CB26525718F_= Content-Type: text/plain; charset="US-ASCII" Sheetal, I think problem is with the port number only. Default port would always be 25 for the mail server and you are not specifying the any specific port number in your program it means it will pick the default port number but you should first check it with your network people that mail server uses the default port i.e. 25 or some other port. If some other port then set the port number also in your program. Check it, I think it will definitely wotk for you. Thanks & Regards Sunil Sahu Sr. Software Engineer Ph. +91-124-4047100 Ext. 752 "Patil, Sheetal" 06/16/2006 10:36 AM Please respond to "Struts Users Mailing List" To "Struts Users Mailing List" cc Subject urgent- exception in sending e-mail from application Hello friends I am trying to send mail from my application Here is the code Properties properties = System.getProperties (); properties.put ("mail.smtp.host","smtp host name"); Session session = Session.getDefaultInstance (properties,null); Message message = new MimeMessage (session); try { message.setFrom (new InternetAddress ("patils1@diebold.com")); message.setRecipient (Message.RecipientType.TO,new InternetAddress ("patils1@diebold.com")); message.setSubject ("Hi "); message.setText ("How is it going ?"); message.setSentDate (new Date ()); Transport.send (message); System.out.println ("Message sent !!!"); } catch (MessagingException e) { e.printStackTrace (); } But this code is giving me exception javax.mail.MessagingException: Could not connect to SMTP host: usncex10.ad.diebold.com, port: 25 is there any additional setting's required for this one plse let me know Sp --=_alternative 00224CB26525718F_=--