title: GAE - When I deploy app does not function, but on localhost it works?
body: <p>I have coded a gae engine java mail api using app.</p>
  
  <p>my appengine-web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;appengine-web-app xmlns="http://appengine.google.com/ns/1.0"&gt;
    &lt;application&gt;mailapps&lt;/application&gt;
    &lt;version&gt;1&lt;/version&gt;
  
    &lt;!--
      Allows App Engine to send multiple requests to one instance in parallel:
    --&gt;
    &lt;threadsafe&gt;true&lt;/threadsafe&gt;
  
    &lt;!-- Configure java.util.logging --&gt;
    &lt;system-properties&gt;
      &lt;property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/&gt;
    &lt;/system-properties&gt;
  
    &lt;!--
      HTTP Sessions are disabled by default. To enable HTTP sessions specify:
  
        &lt;sessions-enabled&gt;true&lt;/sessions-enabled&gt;
  
      It's possible to reduce request latency by configuring your application to
      asynchronously write HTTP session data to the datastore:
  
        &lt;async-session-persistence enabled="true" /&gt;
  
      With this feature enabled, there is a very small chance your app will see
      stale session data. For details, see
      http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions
    --&gt;
  
  &lt;/appengine-web-app&gt;
  </code></pre>
  
  <p>When I run the app on localhost I everything works well, but when I run deploy it on gae and run it I get:</p>
  
  <blockquote>
    <p>Error: Server Error The server encountered an error and could not
    complete your request.</p>
    
    <p>If the problem persists, please report your problem and mention this
    error message and the query that caused it.</p>
  </blockquote>
  
  <p>Whats wrong with my app? Can you please help me?</p>
  
  <p><strong>1.UPDATE_</strong></p>
  
  <p>gae logs say:</p>
  
  <blockquote>
    <p>java.lang.RuntimeException: javax.mail.SendFailedException: Send
    failure (javax.mail.MessagingException: Illegal Arguments
    (java.lang.IllegalArgumentException: Unauthorized Sender: Unauthorized
    sender))</p>
  </blockquote>
  
  <p><strong>2.UPDATE</strong></p>
  
  <pre><code>import java.io.IOException;
  import java.util.Properties;
  import java.util.logging.Logger;
  
  import javax.mail.Message;
  import javax.mail.Session;
  import javax.mail.Transport;
  import javax.mail.internet.InternetAddress;
  import javax.mail.internet.MimeMessage;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  @SuppressWarnings("serial")
  public class FeedbackServlet extends HttpServlet {
  
      private static final Logger log = Logger.getLogger(FeedbackServlet.class.getName());
  
      @Override
      protected void doPost(HttpServletRequest req, HttpServletResponse resp)
              throws ServletException, IOException {
          String name = req.getParameter("name");
          String description = req.getParameter("description");
          String email = req.getParameter("email");
          Properties props = new Properties();
          Session session = Session.getDefaultInstance(props, null);
          log.info(description + name + email + " :Daten extrahiert!");
          String msgBody = name  + " :Name der Person" + "\n" + description + " :Beschreibung der Person" + "\n" + email + " :EMAIL";
  
          try {
              Message msg = new MimeMessage(session);
              msg.setFrom(new InternetAddress("mailapps@gmail.com",
                      "It works"));
              msg.addRecipient(Message.RecipientType.TO, new InternetAddress("maximus@gmail.com", "Your name"));
              msg.setSubject("Bestellung");
              msg.setText(msgBody);
              log.info("Message send!");
              Transport.send(msg);
  
          } catch (Exception e) {
              resp.setContentType("text/plain");
              resp.getWriter().println("Something went wrong. Please try again.");
              throw new RuntimeException(e);
          }
  
          resp.setContentType("text/plain");
          resp.getWriter().println(
                  "Thanks you for your feedback. An Email has been send out.");
      }
  }
  </code></pre>
  
  <p>Thats the servlet!</p>