You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Vasko Tomanov <va...@web.bg> on 2002/06/06 09:15:41 UTC
blank mails
I make a java servlet that automaticali send email trow ( using standart
socket connection to ST) James SMTP, but sometimes the mail are blank
all things like subject, To, From are correect but the body of mail are
blank - the mail evry time are simple text
exaple of method that send mail trow james smtp
exapmel :
sendMsg(25,"212.50.9.33", "LOgin: ta6e8rrgbz, Password: ZT7Tb8Lc6a" ,
"vasko@web.bg", "support@web.bg");
private void sendMsg(int port, String server, String message, String
dest, String origin)
{
PrintWriter to;
BufferedReader from;
String str;
Socket socket;
try {
socket = new Socket(InetAddress.getByName(server),port);
to = new PrintWriter( new BufferedWriter ( new OutputStreamWriter (
socket.getOutputStream())),true);
from = new BufferedReader( new InputStreamReader (
socket.getInputStream()));
//str = from.readLine();
to.println("helo localhost");
//str = from.readLine();
to.println("mail from: <"+origin+">");
//str = from.readLine();
to.println("rcpt to: <"+dest+">");
//str = from.readLine();
to.println("data");
//str = from.readLine();
to.println("Subject: FREE Dial-up account");
to.println("From: support@web.bg");
to.println("");
to.println("");
to.println(message);
to.println("");
to.println("");
to.println(".");
to.println("");
to.println("");
//str = from.readLine();
to.flush();
to.close();
from.close();
socket.close();
} catch ( Exception e ) {}
}
if somebody have any adea to detect the problem please mail me
best regards
vasko
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: blank mails
Posted by Vasko Tomanov <va...@web.bg>.
ok thank's but it work propertly most time without quit :)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: blank mails
Posted by Danny Angus <da...@thought.co.uk>.
to.println("quit");
?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>