I'm currently working on a project for school and I'm trying to use sSMTP to send emails from java to a user using a text file. Executing from the command line ssmtp email@gmail.com < msg.txt
works just fine and sends me the email with the information contained in msg.txt. However, when I try to do it in java using ProcessBuilder it doesn't send an email.
`ProcessBuilder builder = new ProcessBuilder;
builder.command("ssmtp", "email@gmail.com", "<", "msg.txt");
Process p = builder.start();`
I believe that it doesn't like where I try to pipe in msg.txt. If anyone knows a better way to do this that would be great. I haven't been able to find anything yet and am not sure how to do it myself