Hi
I have a problem sending this information
to this page
Its just not sending the mail, but Im not getting any errors.
I have a problem sending this information
Code:
private void postFormToServer() throws Exception {
String address = UtilityStore.WBW_SERVER;
URL url = http://myadress.com/send_mail.php;
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
if(connection instanceof HttpURLConnection) {
((HttpURLConnection)connection).setRequestMethod("POST");
}
OutputStreamWriter streamWriter = new OutputStreamWriter(connection.getOutputStream());
streamWriter.write(customerNameField + SEPARATOR + customerInfoField + SEPARATOR + emailField);
streamWriter.close();
}
Code:
<?php
$to = "my mail@gmail.com";
$emailField= $_POST["emailField"];
$subject= $_POST["subject"];
$customerNameField= $_POST["customerNameField"];
$customerInfoField= $_POST["customerInfoField"];
if (mail ($to, $subject, $customerInfoField ,"From: $customerNameField <$emailField>"))
echo nl2br("<h2>Sent!</h2>
<b>mottagare:</b> $to
<b>ämne:</b> $subject
<b>meddelande:</b>
$customerInfoField
");
else
echo "No";
?>