This topic is locked
[SOLVED]

 Email from Custom Button

5/22/2019 12:41:08 PM
PHPRunner General questions
S
stanbar1 author

Hi..I have some issue wit email from button. i read many samples and no chance....i have custom button(Accept Job)..i need when drivers accept job i get email with drivers name, job number, Passenger name..i got this all field in table jobs. i try on server:

$from = "myemail@test.com";

$to = "sbarmotin@yahoo.com";

$msg = "The new record was added: ";

$subject="New record";
$msg.= "Job: ".$values["Job"]."\r\n";

$msg.= "Date: ".$values["Date"]."\r\n";

$msg.= "PassengerName: ".$values["PassengerName"]."\r\n";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));

if(!$ret["mailed"]){

echo $ret["message"];

}

and on client after:

ctrl.setMessage(result["msg"]);

i need help Please

W
WilliamBDevClub member 5/22/2019

There is an error in your code. $email is not being used. You changed it to $to. Your code should be:

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