Jump to content

php mail function not working


cainam29

Recommended Posts

need help, mail function not working...

 

here is my php mail code:

 

<?php
//for getting the variable in the URL
$WirelessRemaining= $_GET['WirelessRemaining'];
$WirelineRemaining = $_GET['WirelineRemaining'];
$date1 = $_POST['date1'];
$output= $_POST['output'];

require 'include/DB_Open.php';

 $to = "aaa.bbb@ccc.com";
 $subject = "Test, $date1";
 $body = "$output";
 
 $headers = 'MIME-Version: 1.0' . "\r\n";
 $headers .= 'Content-Type: text/html; charset=ISO-8859-1' . "\r\n";
 $headers .= "From: aaa bbb <aaa.bbb@ccc>\r\n";

 if (mail($to, $subject, $body)) {
   echo("<p>Message successfully sent!</p>");
  } else {
   echo("<p>Message delivery failed...</p>");
  }

include 'include/DB_Close.php';  
?>

this codes would have values coming from the generated report, which was performed by another php page

$WirelessRemaining= $_GET['WirelessRemaining'];
$WirelineRemaining = $_GET['WirelineRemaining'];

while is a date field from my main php page where the email button would be click to send mail

$date1 = $_POST['date1'];

and this is from the output of my report generator:

$output= $_POST['output'];

here is how i call the mail php page

$("#Email").on('click',function() {
			var date1 = $('#Date').val();
			var output = $('#report_sample.php').val();
            $.post('mail.php',{date1:date1, output:output}, function(data){
            $("#results").html(data);
            });
            return false;
		});

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.