turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Chalmers" <colin.chalm...@maxware.nl>
Subject Re: mail message
Date Thu, 18 Oct 2001 17:30:54 GMT
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

<snip>
          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();
</snip>


----- Original Message -----
From: "Scott A. Roehrig" <saroehr@hotmail.com>
To: <turbine-user@jakarta.apache.org>
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


Mime
View raw message