Return-Path: Delivered-To: apmail-jakarta-turbine-user-archive@jakarta.apache.org Received: (qmail 47293 invoked by uid 500); 18 Oct 2001 17:34:57 -0000 Mailing-List: contact turbine-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: turbine-user@jakarta.apache.org Delivered-To: mailing list turbine-user@jakarta.apache.org Received: (qmail 47119 invoked from network); 18 Oct 2001 17:34:54 -0000 Message-ID: <006501c157fa$aeada2a0$4201a8c0@maxware.nl> From: "Colin Chalmers" To: References: Subject: Re: mail message Date: Thu, 18 Oct 2001 19:30:54 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Scott, I tested your snippet using my version below And everything worked great!! The only problem I had was if I set the headers to "", otherwise.....No probs. I would check that the parameters you're trying to read from are indeed filled (write to logfile and/or screen) and/or put the code in a try/catch block. That way you should see what the errors are. Let me know how you get on. /Colin MailMessage mail = new MailMessage(); // set mail properties mail.setHost("192.168.1.1"); mail.setDebug(true); // mail.setHeaders(""); mail.setFrom("collie@localhost"); mail.setTo("collie@xs4all.nl"); // check if Cc: is null mail.setCc("colin.chalmers@maxware.nl"); mail.setSubject("MailmessageTest"); mail.setBody("Message"); // send mail and verify result boolean result = mail.send(); ----- Original Message ----- From: "Scott A. Roehrig" To: Sent: Thursday, October 18, 2001 6:25 PM Subject: mail message > In looking through the api docs, I am hoping that this is a simple coding > error. Would anyone have any thoughts on this snippet of code designed to > send a simple email using the MailMessage class. I don't return an > exception, but then again I never receive the email. I am sending it through > a remote mail gateway. I define the host in the descriptor. > > // create turbine email > MailMessage mail = new MailMessage(); > // set mail properties > mail.setHost(config.getAttribute("host")); > file://mail.setDebug(config.getAttribute("debug")); > file://mail.setHeaders(""); > > mail.setFrom(request.getSession().getUser().getGivenName()+"@localhost"); > mail.setTo(request.getParameter("To")); > // check if Cc: is null > if (request.getParameter("Cc") != null) { > mail.setCc(request.getParameter("Cc")); > } > mail.setSubject(request.getParameter("Subject")); > mail.setBody(request.getParameter("Message")); > // send mail and verify result > boolean result = mail.send(); > > Thanks for any thoughts:) > > Scott > > --------------------------------------------------------------------- > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: turbine-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: turbine-user-help@jakarta.apache.org