tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "vishwam" <gvish...@info-telecomsys.com>
Subject Re: unable to send a java mail
Date Thu, 28 Apr 2005 13:29:04 GMT
my smtp server requires authentication with username & password

but i couldn't find these smtp authentication fields in java mail
specification
my email program is like this


public class MailServlet extends HttpServlet {

  static final String FROM = "gvishwam@info-telecomsys.com";
  static final String TO = "vishwam_1232@yahoo.com";

  public void doGet(HttpServletRequest req, HttpServletResponse res)
                               throws ServletException, IOException {
    res.setContentType("text/plain");
    PrintWriter out = res.getWriter();

    ParameterParser parser = new ParameterParser(req);
    String from = parser.getStringParameter("from", FROM);
    String to = parser.getStringParameter("to", TO);

    try {
      SmtpClient smtp = new SmtpClient("xxxxxx");  // smtphost name
      smtp.from(from);
      smtp.to(to);
      PrintStream msg = smtp.startMessage();

      msg.println("To: " + to);  // so mailers will display the To: address
      msg.println("Subject: Customer feedback");
      msg.println();

      Enumeration enum1 = req.getParameterNames();
      while (enum1.hasMoreElements()) {
        String name = (String)enum1.nextElement();
        if (name.equals("to") || name.equals("from")) continue;  // Skip
to/from
        String value = parser.getStringParameter(name, null);
        msg.println(name + " = " + value);
      }

      msg.println();
      msg.println("---");
      msg.println("Sent by " + HttpUtils.getRequestURL(req));

      smtp.closeServer();
}
----- Original Message -----
From: "Dale, Matt" <Matt.Dale@beCogent.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Thursday, April 28, 2005 6:49 PM
Subject: RE: unable to send a java mail


The problem appears to be with your SMTP server and not java. Looks like you
might need to open it up a bit to relaying.

Ta
Matt

-----Original Message-----
From: vishwam [mailto:gvishwam@info-telecomsys.com]
Sent: 28 April 2005 14:18
To: Tomcat Users List
Subject: unable to send a java mail


iam trying to send a simple email using javamailAPI
but iam getting the following error

sun.net.smtp.SmtpProtocolException: 553 Sorry, that domain isn't in my list
of allowed rcpthosts.

 at sun.net.smtp.SmtpClient.issueCommand(Unknown Source)
 at sun.net.smtp.SmtpClient.toCanonical(Unknown Source)

Iam trying for last 4 days
,but i couldn't solve this problem

it is important ,bcos iam using it in my project
i'll be grateful to someone who solves this problem

thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message