This topic is locked

Send result by email (master-details)

2/9/2016 9:13:43 AM
PHPRunner General questions
M
macskafogo author

Hi !
What's wrong ?:

global $dal;

$msg="";

$email= "free@free.com";

$sql = "SELECT * FROM table1 WHERE order_id=".$keys['order_id']."' ";

$rs1 = CustomQuery($sql);

$msg.="<html>

<head>

<title>My Title</title>

</head>

<body> <table width=\"800\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">

<tr>

<td>

<h2>Big Title Area.</h2>";

while($data1 = db_fetch_array($rs1))

{

$msg.="<p>".$data1["order_id"].",</p>

<p> Some text. </p>

<p> Some more text.</p>

<p> Even More Text: </p>

<table border=\"0\" width=\"800\" cellspacing=\"10\" cellpadding=\"0\">

";

}

$msg.= "</table>
</td>

</tr>

</table>

</body>

</html> ";

$subject="My Subject.";

$from="email@email.com";

$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'htmlbody' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"];


It does not send the results.

Please help.

Thanks

admin 2/9/2016

You need to figure out what exactly is happening there. Does it send anything at all? Any error messages?

M
macskafogo author 2/10/2016



You need to figure out what exactly is happening there. Does it send anything at all? Any error messages?


Hi !
No error message.

admin 2/10/2016

Does it send anything at all?

M
macskafogo author 2/10/2016

Save the record, but does not send e-mail.

I would like to send email after record added. (like invoice)
PLease help

admin 2/11/2016

Start with something small like sending a simple email. You need to find out if this is something related to your code or to email settings.
If simple hardcoded email is being sent that means something is wrong with your code. If simple email is not being sent - issue is with email settings.