Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:38:40+00:00 2026-05-23T11:38:40+00:00

I have this issue that I cant seem to solve easily. I want to

  • 0

I have this issue that I cant seem to solve easily.

I want to send an email from within a GWT webApp. I did everything correctly in terms of putting the code in the server side and invoking it with an Async interface as its expected. So all is ok, except that when I execute the send email function, I get an error of type mailexception with and inner exception of type AccessControlException "access denied (java.net.SocketPermission <my smtp server> resolve)".

Now I tested the function in a regular Java console app and it worked perfectly. So I guess I need to add some code to grant access somehow. Anyone can assist me in this?

Here is the code of the send email:

    public void SendMail(String name, String email, String message) throws EmailException{
    Email email1 = new SimpleEmail();
    email1.setHostName("mysmtpserver");
    email1.setSmtpPort(25);
    email1.setAuthenticator(new DefaultAuthenticator("myemail", "mypwd"));
    email1.setTLS(false);
    email1.setFrom(email);
    email1.setSubject("Feedback from your website");
    email1.setMsg(escapeHtml(message));
    email1.addTo("targetemail");
    email1.send();
}

and that’s the code of the class calling it:

public class SiteDataServiceImpl extends RemoteServiceServlet implements SiteDataService {
@Override
public boolean SendEmail(String name, String email, String message) throws IllegalArgumentException {
    try {
        new Common().SendMail(name, email, message);
        return true;
    } catch (EmailException e) {
        e.printStackTrace();
        return false;
    }
}

}

PS: I thought at first that I need to include the mail.jar archive, but it is included in the gwt toolkit already, so its not the cause of the problem. And I am using Jetty with Eclipse.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:38:41+00:00Added an answer on May 23, 2026 at 11:38 am

    Ok this may sound weird, but I deployed the code on a dev server (linux) and it worked like a charm.

    On my machine a windows one, it is still not working, and still getting the same error. But since it works on the dev machine, I am happy.

    However this still doesnt explain the reason….

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK so I have an xslt issue that I cannot seem to solve. This
So I have a frustratingly simple issue that I cannot seem to solve. If
I have an issue that I can't seem to solve. I am randomly generating
I have a panel layout issue that I can't seem to solve. I have
Heyy can somebody help me ? i have this issue that still do know
I have this issue with ComboBox that uses IEnumerable<Brush> as ItemsSource; the problem lies
I have never come across this issue but most recently I noticed that a
I have an issue that seems like very flaky behavour, is this a problem
I am having this issue. I have a script that checks if variable exists,
I am having some problems figuring out this issue. I have a server that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.