Possible Duplicate:
Possible to send automated email?
This question has been asked in multiple variations throughout stackoverflow, but I can't quite find one that applies to me or that answers my question. It seems like it should be more simple but all I want is for my app to send an asynchronous email in the background. No GUI, no user input, just that when something happens in the model it emails me about it.
Thanks in advance,
Jordan
IOS doesn't support to mail in background. You must implement the USer interaction & only clicking over send button will be sending the mail. As an alternate you should implement the WebService for this & you can call it anywhere in you code.
php required:
<?php
//-- POST are variables from details.js
$names = $_POST['names'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$crust = $_POST['crust'];
$message1 = $_POST['message'];
//-- clean up the javascript array
$toppings = str_replace('"','',substr(substr(stripslashes($_POST['toppings']),1),0,-1));
$toppings = explode(",\n", $toppings);
//-- Where the order will be sent
$to = $address2;
$subject = "your_Order!";
$message = $message1 ;
//-- The headers will let us send HTML code as an email
$headers = "From: contact@your_domain.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
//-- if mail gets sent, return true, else return false. This gets handed off the our onload method in details.js
if (mail($to,$subject,$message,$headers))
{
$response = array('mail' => true);
}
else
{
$response = array('mail' => false);
}
echo json_encode($response);
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With