i have main page calls php page generate report, on same main page, have send email button calls mail php page not sending generated report specified email address, how can make send email button work?
what want happen here after generated report ill send email keeping same table format...
here's mail php:
<?php //for getting variable in url $wirelessremaining= $_get['wirelessremaining']; $wirelineremaining = $_get['wirelineremaining']; $dates = $_post['dates']; $output= $_post['$output']; require 'include/db_open.php'; $to = "aa.aa@xy.com"; $subject = "test, $dates"; $body = "$output"; $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "from: aa <aa.aa@xy@ccc.com>\r\n"; if (mail($to, $subject, $body)) { echo("<p>message sent!</p>"); } else { echo("<p>message delivery failed...</p>"); } include 'include/db_close.php'; ?> here's code calls report generator , mail php:
$(document).ready(function(){ $("#retrievelist").on('click',function() { var xid = $('#xid').val(); var date = $('#date').val(); $.post('retrieve_test.php',{xid:xid, date:date}, function(data){ $("#results").html(data); }); return false; }); $("#report").on('click',function() { var dates = $('#date').val(); $.post('report_sample.php',{dates:dates}, function(data){ $("#results").html(data); }); return false; }); $("#email").on('click',function() { var date1 = $('#date').val(); $.post('mail.php',{date1:date1, output:output}, function(data){ $("#results").html(data); }); return false; }); });
$dates = $_post['dates']; $output= $_post['$output']; should be
$dates = $_post['date1']; $output= $_post['output'];
Comments
Post a Comment