hello sir,
i am new to jsp and i have to use jsp mail in my project and i got a jsp mail script but unfortunately it is showing error like this one!

530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257 f10sm3473193anh.25

i am using

smtp server:smtp.gmail.com

and there is no error except that i think it is connecting to smtp server because i tried by giveng a wrong server name and port,but i dont know what is authentication means...

here is my complete code

<%@ page language="java" import="javax.naming.*,java.io.*,javax.mail.*,



  Session mailSession = Session.getInstance(System.getProperties());
  Transport transport = new SMTPTransport(mailSession,new URLName("smtp.gmail.com"));

  MimeMessage m = new MimeMessage(mailSession);
  m.setFrom(new InternetAddress(%><%request.getParameter("from")%><%));
  Address[] toAddr = new InternetAddress[] {
              new InternetAddress(%><%request.getParameter("to")%><%)
  m.setRecipients(javax.mail.Message.RecipientType.TO, toAddr );
  m.setSentDate(new java.util.Date());
  m.setContent(%><%request.getParameter("description")%><%, "text/plain");
  out.println("Thanks for sending mail!");
catch(Exception e){




friends please help me as soon as possible..
thanking u all!!!

waste forum...no one is there to answer a simple question...
bye bye to daniweb.com...

you should set mail server, example:bestmailserver of firstmailserver.
If u test on localhost: u should change "transport.connect("smtp.gmail.com",587,"xxx@gmail.com","xxx");"
by : transport.connect("localhost",25,null,null);
I tried and success.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.