wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes Problem in Sending Mail Using Sockets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Problem in Sending Mail Using Sockets" Watch "Problem in Sending Mail Using Sockets" New topic
Author

Problem in Sending Mail Using Sockets

Raghavendra Rao Damojipurapu
Greenhorn

Joined: Feb 20, 2006
Posts: 1
Hi All,

I am trying to send a mail using Socket in my jsp.The mail is going but some times the jsp is hanging.Why I am not able to figure out.I have kept log statements and came to know the server response as follows :
--------------------------------------------------------------------------
responseline = 250 2.1.0 <cbalakrishna@lucent.com>... Sender ok
responseline = 250 2.1.5 <cbalakrishna@lucent.com>... Recipient ok
responseline = 250 2.1.5 <test2>... Recipient ok
responseline = 354 Enter mail, end with "." on a line by itself
responseline = 250 2.0.0 k22CICD21051 Message accepted for delivery
responseline = 503 5.0.0 Need MAIL before RCPT
responseline = 503 5.0.0 Need MAIL before RCPT
responseline = 503 5.0.0 Need MAIL command
responseline = 500 5.5.1 Command unrecognized: "To: Balakrishana <cbalakrishna@lucent.com>"
responseline = 500 5.5.1 Command unrecognized: "To: test2 <test2>"
responseline = 500 5.5.1 Command unrecognized: "Subject: Test"
responseline = 500 5.5.1 Command unrecognized: "All, "
responseline = 500 5.5.1 Command unrecognized: ""
responseline = 500 5.5.1 Command unrecognized: ""
responseline = 500 5.5.1 Command unrecognized: "The following recognition is submitted: "
responseline = 500 5.5.1 Command unrecognized: ""
responseline = 500 5.5.1 Command unrecognized: ""
responseline = 500 5.5.1 Command unrecognized: "Nominating Colleague: t1"
responseline = 500 5.5.1 Command unrecognized: "Nominating Colleague Email: t1"
responseline = 500 5.5.1 Command unrecognized: "Nominee Name: t1"
responseline = 500 5.5.1 Command unrecognized: "Nominee Email: t1@lucent.com"
responseline = 500 5.5.1 Command unrecognized: "Supervisor Name: test1"
responseline = 500 5.5.1 Command unrecognized: "Supervisor Email: test2"
responseline = 500 5.5.1 Command unrecognized: "Nomination Type: Extra Mile"
responseline = 500 5.5.1 Command unrecognized: "Accomplishment: test data on march 2nd 12345"
responseline = 500 5.5.1 Command unrecognized: ""
responseline = 500 5.5.1 Command unrecognized: ""
responseline = 500 5.5.1 Command unrecognized: "."
responseline = 221 2.0.0 ihgp.ih.lucent.com closing connection
responseline = null
--------------------------------------------------------------------------

Why I am getting 503(i.e DISORDER OF THE COMMANDS) error i dont know because the commands i have used are in perfect order like HELO, MAIL, RCPT TO, DATA, '.', QUIT.
I am getting the above log when the jsp is not hanging.
when the jsp hangs I am getting the log up to the statement below :
responseline = 503 5.0.0 Need MAIL command


can anyone plz help me
I am badly stuck here
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42360
    
  64
Welcome to JavaRanch.

Not a direct answer, but is there a particular reason you're not using an existing mail client library like Commons Net? (I'll leave aside for the moment that it is considered bad design to do this kind of thing in a JSP page, and not in a bean or a servlet.)
[ March 02, 2006: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem in Sending Mail Using Sockets