
May 12th, 2003, 08:35 AM
|
|
|
|
Join Date: Apr 2007
Posts: 37
Time spent in forums: < 1 sec
Reputation Power: 2
|
|
|
SMTP lower lever mail sending JAVA!
I made a program that makes connection with SMTP server and sends into server. The problem is that sometimes the mail does'nt get into the server at all!
I just want to know can there be problems with the whitespaces? And if anyone knows how i can see with JAVA those whitespaces in text?
JAVA:
php Code:
Original
- php Code |
|
|
|
public boolean saadamail(String kellele,String pealkiri, String sisu) throws IOException{ try{ Socket sc=new Socket(masin, 25); PrintWriter valja=new PrintWriter(sc.getOutputStream(), true); BufferedReader sisse=new BufferedReader(new InputStreamReader( sc.getInputStream() )); PrintWriter tagasi= new PrintWriter (System.out, true); valja.println("helo "+masin); String s=sisse.readLine(); tagasi.println(s); valja.println("mail from: "+saatja); valja.println("rcpt to: "+kellele); valja.println("DATA"); valja.println("Subject: "+pealkiri); valja.println(""); valja.println(sisu);//entry valja.println("."); sc.close(); valja.close(); System.out.println (df.format (d )+ " "+pealkiri+ " saatsin just "+mitu+ " maili ära"); return true; }catch(IOException e){e.printStackTrace();return false;} }
|