Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package mail;
- import java.io.*;
- /**
- *
- * @author thorstenl
- */
- import java.io.IOException;
- /**
- * Assumes UTF-8 encoding. JDK 7+.
- */
- public class Manager {
- public static void main(String... aArgs) throws IOException {
- /* Mail mail = new Mail();
- mail.readFile(C:\opus\Mail\Sample.html);
- Scanner sc = new Scanner(system.in);
- // datei einlesen.
- // mail erstellen
- // mail befüllen
- // mail versenden
- //C:\opus\Mail\Sample.html */
- Manager manager = new Manager();
- String htmlContent = manager.readFile("C:\\opus\\Mail\\Sample.html");
- System.out.println(htmlContent);
- }
- public String readFile(String filePath) {
- String output = "";
- System.out.println("File einlesen.");
- try {
- FileReader fr = new FileReader(filePath);
- BufferedReader br = new BufferedReader(fr);
- String zeile = "null"; /*Wir instanzieren eine Neue Variable, mit dem Namen "zeile", von der klasse "String" (KLassen werden immer groß geschrieben, variablen immer klein). */
- int i = 0;
- while ((zeile = br.readLine()) != null) {
- i++;
- System.out.println("Zeile: " + i+ ", Inhalt: " + zeile);
- output += zeile;
- }
- br.close();
- fr.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return output;
- }
- public void createMail() {
- }
- public void sendMail() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement