He meant it isn't a GWT issue. The code you are trying to make work
has nothing to do with GWT other than it is being referenced from the
server-side code compiled by your GWT app. That said, here's some code
I use to send emails:

<pre>
    try {
      Session mailSession =
Session.getDefaultInstance(getProperties(hostRow));

      Transport transport = mailSession.getTransport();

      MimeMessage message = new MimeMessage(mailSession);

      String body = emailRow.getBodyText();

      message.setSubject(emailRow.getTheme());
      message.setContent(body, "text/plain");

      message.addRecipient(RecipientType.TO,
          new InternetAddress(userRow.getEmail()));

      transport.connect(hostRow.getHostName(), hostRow.getHostPort(),
          hostRow.getAuthUser(), hostRow.getAuthPass());

      transport.sendMessage(message,
message.getRecipients(RecipientType.TO));

      transport.close();
    } catch (Throwable caught) {
      throw new Exception(caught.getMessage());
    }
</pre>

HTH,
Chad

On Sep 28, 8:20 am, newnoise <[email protected]> wrote:
> What does that mean?
>
> On 28 Sep., 15:12, Paul Grenyer <[email protected]> wrote:
>
>
>
> > Hi
>
> > This isn't a GET issue....
>
> > Paul
>
> > On Tue, Sep 28, 2010 at 1:46 PM, newnoise <[email protected]>wrote:
>
> > > Hi,
>
> > > I'm trying to send an email from my GWT-App. I found the following
> > > code using google:
> > > protected void sendMessage(String smtpHost, String fromAddress, String
> > > fromName, String to, String subject, String text) {
> > > // Get system properties Properties
> > > props = System.getProperties();
> > > // Setup mail server
> > > props.put("mail.smtp.host", smtpHost);
> > > // Get session
> > > Session session = Session.getDefaultInstance(props, null);
> > > // Define message
> > > MimeMessage message = new MimeMessage(session);
> > > // Set the from address
> > > message.setFrom(new InternetAddress(fromAddress, fromName));
> > > // Set the to address
> > > message.addRecipient(Message.RecipientType.TO, new
> > > InternetAddress(to));
> > > // Set the subject
> > > message.setSubject(subject);
> > > // Set the content
> > > message.setContent(text, "text/html");
> > > // Send message
> > > Transport.send(message);
> > > }
>
> > > But I'm getting a "java.lang.AssertionError: null".
>
> > > I was wondering why I do not have to enter a password for the smtp-
> > > server, and what to enter at String smtpHost, as I have to enter my
> > > Smtp-Host at props.put() again ...
>
> > > Thanks!
> > > Tom
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Google Web Toolkit" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<google-web-toolkit%2Bunsubs
> > >  [email protected]>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> > --
> > Thanks
> > Paul
>
> > Paul Grenyer
> > e: [email protected]
> > b: paulgrenyer.blogspot.com
> > t: pjgrenyer

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to