This topic is locked

Send Email - Cannot get it working - Before addrecord email contents

1/26/2022 6:43:11 AM
PHPRunner General questions
1NET author

Before addrecord email contents

I have followed the process to email the contents of a form including the attachments to an email address.

i have also configured the email settings (PHPRunner 10.7 Misc Page) to reflect the exact settings my domain / cPanel based email server operates with,
i am getting an error: SMTP Error: Could not authenticate.SMTP Error: Could not authenticate.

I have tried many settings including SSL & TLS.
I have registered a gmail account to attempt to use this feature.
Xlinesoft support suggests not to enable 2FA however you cannot create an APP Password unless you do enable 2FA in Gmail
After following the process provided by support Gmail still fails with this error
SMTP Error: Could not connect to SMTP host.SMTP Error: Could not connect to SMTP host.
if I change the default settings in Phprunner 10.7 to reflect what GMAIL states will work Port 465 SSL smtp.gmail.com i receive this error
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingSMTP'>https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingSMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

I have removed all files from the webserver export folder and re-build the project to a clean directory and still no luck

Has anyone else experienced these issues with emailing the contents of a form?

BeforeRecordAdded script
$email="info@1net.com.au";

$from="info@1net.com.au";
$msg="";
$subject="New BC Audit Quote Request";
$msg.= "Contact name: ".$values["bc_contact_name"]."\r";
$msg.= "Contact phone: ".$values["bc_phone"]."\r";
$msg.= "Contact email: ".$values["bc_email"]."\r";
$msg.= "Contact prefered method: ".$values["bc_contact_name"]."\r";
$msg.= "End of year date: ".$values["bc_EOY_date"]."\r";
$msg.= "Gross revenue: $".$values["bc_gross_revenue"]."\r";
$msg.= "Individual strata units: ".$values["bc_strata_units"]."\r";
$msg.= "BC manager?: ".$values["bc_manager"]."\r";
$msg.= "BC manager name: ".$values["bc_manager_name"]."\r";
$msg.= "BC manager phone: ".$values["bc_manager_phone"]."\r";
$msg.= "Lodgement of ITR required?: ".$values["bc_lodge_ITR"]."\r";
$msg.= "Accounting software?: ".$values["bc_use_acc_soft"]."\r";
$msg.= "Accounting software name: ".$values["bc_acc_soft_name"]."\r";
$fileArray = my_json_decode($values["bc_upload"] );
$attachments = array();
foreach($fileArray as $f)
{
$attachments[] = array("path" => $f["name"]);
}

$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, "attachments" => $attachments));
if(!$ret["mailed"])
echo $ret["message"];
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];

1NET author 1/26/2022

I believe the answer may be that the environment i'm using is running locally for development purposes via XAMPP
any thoughts?