2013-02-25 3 views
0
I am using following java code to send email ticket which is Html code in a mail body and also sending same ticket as attachment a html file. but some extra lines coming in the body for email clients other than Microsoft outlook like g mail etc,Here is the code, 

HtmlEmail service = new HtmlEmail(); 
//getting body as Html content  
String `strBodyText` = getSpotTicketContent(bobTicketVO,strBhLogoCid);  
FileWriter fw = new FileWriter(file.getAbsoluteFile());  
BufferedWriter bw = new BufferedWriter(fw); 
bw.write(strBodyText);  
bw.close();  
URL filePath = new URL("file:///"+file.getPath());  
service.attach(filePath, ""+orderType+""+dealID+".html""Baydonhill Order Ticket");  
service.send();  

모든 일이 잘 부착과 몸은 ------ = _ Part_8_20713850.1361775519720--로 몸을 앞으로 한 추가 라인을 제외하고 제대로 나오는 것 같다추가 라인은

나는 1.4 enter code here

답변

0

당신이 그것을에게 자세한 내용을 설명 할 수 아파치 일반적인 이메일 1.2과 자바를 사용하고? 당신이 파일을 읽을 때 해당 스크립트를 사용하는 경우

FileWriter fw = new FileWriter(file.getAbsoluteFile());  
BufferedWriter bw = new BufferedWriter(fw); 
bw.write(strBodyText);  
bw.close();  

어쩌면, 일부 문자열이 포함 : 원인은 당신이 코드 파일을 읽을 때 문제가 생각? 정확히 알지 못합니다 ...