Java - crear trazas

 
Vista:

crear trazas

Publicado por mirdch (2 intervenciones) el 15/05/2007 21:49:58
hola os dejo aqui esta función y me gustaria que alguien me dijiera como se puede optimizar mas para crearle unas trazas

String body = getBodyContent().getString();



try {



logger.warn("SendFriend - About to send a mail...");



SmtpClient send = new SmtpClient("relayint01.yacom.srv");



logger.warn("SendFriend - from = " + from);



logger.warn("SendFriend - to = " + to+", "+ghostcopy);



logger.warn("SendFriend - subject = " + subject);



logger.warn("SendFriend - contenttype = " + contenttype);



send.from(from);



send.to(to+", "+ghostcopy);



PrintStream out = send.startMessage();



out.print("From: " + from+"\n");



out.print("To: " + to +"\n");



out.print("Subject: " + subject+"\n");



out.print("Content-Type: "+contenttype+"\n");



out.print("Content-Transfer-Encoding: 8bit\n");



out.print("MIME-Version: 1.0\n");



out.print("\n");



out.print(body);



out.flush();



out.close();



send.closeServer();



pageContext.getRequest().setAttribute("SendSuccessful", "yes");



} catch (IOException e) {



logger.error("[viajar.SendFriend]-->Problemas al enviar el mail a "+to+ghostcopy+" subject = " + subject + " ERROR:"+e.getMessage());



//System.out.println("[viajar.SendFriend]-->Problemas al enviar el mail a "+to+" ."+e.getMessage());



System.out.println("[viajar.SendFriend]-->");



e.printStackTrace();



if ("true".equals(seterror))



pageContext.getRequest().setAttribute("error", "Error al enviar el mensaje.");
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder