Posted By:
Damu_Gudala
Posted On:
Tuesday, July 23, 2002 08:05 AM
how to send mail thru an ordinary java programme? I am importing "java.net.*", "java.io.*", "java.util.Date" and some java code to send an E-mail. My Mail server is working perfect. But when I execute the my java programme it's giving the exception, java.lang.StringIndexOutOfBoundsException: String index out of range: 0. Earlier I used to send mail with the same Programme. What's wrong? Here is my sendMail method code. public void sendMail() { try{ String response; Socket mailSock = new Socket (Mailserver, SMTPPort); BufferedReader bin= new BufferedReader(new InputStreamReader(mailSock.
More>>
how to send mail thru an ordinary java programme?
I am importing "java.net.*", "java.io.*", "java.util.Date" and some java code to send an E-mail.
My Mail server is working perfect.
But when I execute the my java programme it's giving the exception,
java.lang.StringIndexOutOfBoundsException: String index out of range: 0.
Earlier I used to send mail with the same Programme.
What's wrong?
Here is my sendMail method code.
public void sendMail()
{
try{
String response;
Socket mailSock = new Socket (Mailserver, SMTPPort);
BufferedReader bin= new BufferedReader(new InputStreamReader(mailSock.getInputStream()));
PrintWriter pout= new PrintWriter( new OutputStreamWriter(mailSock.getOutputStream()));
response=bin.readLine();
...........
...........
...........
mailSock.close();
}
catch(IOException ioe)
{}
}
what's wrong?
Thanks, in advance.
Sincerely
Damu
<<Less