How do I change my mailhost to mail.comcast.net

Im using

URL url = new URL("mailto:" + email);
URLConnection connection = url.openConnection();
connection.setDoInput(false);
connection.setDoOutput(true);
connection.connect();
PrintWriter out = new PrintWriter(new OutputStreamWriter(connection.getOutputStream()));

to send emails. It completes without errors but the mail does not send.