This topic is locked
[SOLVED]

insert into a table after sending email details

11/15/2024 6:22:46 AM
PHPRunner General questions
A
afa1999 author

Hi,
Is there any possibility to save values into a table after sending an email?
Here is the code ;
$arr = runner_mail(array('to' => $emails, 'subject' => $subject, 'body' => $message, 'from' => $from, 'charset' => 'UTF-8'));

and I would like to insert those records into a table like;

if( result.success )
{
$data = array();
$data["to"] = $values["to"];
$data["subject"] = $values["subject"];
DB::Insert("sent_emails", $data );
}
Thanks for your great support

C
cristi 11/15/2024

From here: https://xlinesoft.com/phprunner/docs/runner_mail_function.htm
There is no such thing "result.succes" but there is "mailed: (true or false) "

So:

if( $arr["mailed"] )
{
$data = array();
$data["to"] = $emails;
$data["subject"] = $subject;
DB::Insert("sent_emails", $data );
}
A
afa1999 author 11/15/2024

Thank you so much

A
afa1999 author 11/15/2024

I got the error message mysqli_real_escape_string() after that
I will try more but any help will be welcomed