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%[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