Send SMS vis SMS Gateway using Java
URL: http://www.smsmatrix.com/?sms-gateway
Copy this code and paste it in your HTML
try
{
String MATRIXURL
= "http://www.smsmatrix.com/matrix";
String USERNAME
= "user@hotmail.com";
String PASSWORD
= "pass72727";
String TXT
= "This is a test, pls ignore";
q
+= "&" + "password=" + URLEncoder.
encode (PASSWORD,
"UTF-8");
q += "&" + "phone=" + PHONE;
q
+= "&" + "txt=" + URLEncoder.
encode (TXT,
"UTF-8");
URL url
= new URL (MATRIXURL
);
conn.setDoOutput (true);
wr.write (q);
wr.flush();
System.
out.
println ("Matrix API Response :");
while ((line
= rd.
readLine()) != null) { System.
out.
println (line
);
} wr.close();
rd.close();
Report this snippet