Hello, I have been using php mail forms for years. I have mailcow and sogo on a new almalinux server with php 7.2.
I am looking for a resource or sample code to access smtp from a php script.
The following format has been working for years on various linux email systems, executed by a web form.
$email = $REQUEST[‘email’] ;
$subject = ‘zzz’;
$first_name = $REQUEST[‘first_name’] ;
$last_name = $REQUEST[‘last_name’] ;
$cell = $REQUEST[‘cell’];
$address = $REQUEST[‘address’];
$city = $REQUEST[‘city’];
$zip = $_REQUEST[‘zip’];
$headers .= “From: xxx@xxx.xxx\r\n”;
$message = “Name: ”.$first_name .“ ”.$last_name.“\nCell: ”.$cell.“\nEmail: ”.$email.“\nAddress: ”.$address.“\nCity: ”.$city.“\nZip: ”.$zip;
mail(“yyy@yyy.yyy”, $subject, $message, $headers);
echo “Submitted!”;
Thunderbird client is working using port 587, normal password, STARTTLS
Thanks for any suggestions or code samples.
Mike