我有一点麻烦,我需要创建一种将字符串发送到服务器的方法,我有点抱怨系统
try {
String errMsg = validateData();
if(errMsg == null){
String mailURL = CLIENT_CONTACT_URL_MAIL_SERVICE;
mailURL = Utils.replaceAll(mailURL, "@toAddress", TO_DEFAULT_ADDRESS);
String content = "";
content = "Nombre: " + this.names.getText() + "\n";
content += "Apellido: " + this.surname.getText() + "\n";
content += "Email: " + this.email.getText() + "\n";
content += "Telefono: " + this.phone.getText() + "\n";
content += "Mensaje: " + this.complains.getText() + "\n";
mailURL = Utils.replaceAll(mailURL, "@bodyContent", URLUTF8Encoder.encode(content));
Utils.getWebData(mailURL, this);
}else{
Dialog.alert(errMsg);
}
} catch (IOException e) {
Logger.logErrorEvent("Error while sending client contact mail");
}
break;