I have a php script that emails a completed order form linked to the script and sends a coppy (cc) to the sender. It has worked for years, but now the server tells me I need to change the “from” setting on the script as it uses the sender’s email address as the “from” address and the server now prevents emails with this format as it can contain a spoofed from address. How can I set the “from” email address to be my own instead of the current setting?
Any help/advice/suggestion would be much appreciated - I have spent 2 days trying to work it out and just don’t know what else to do.
Thank you - here is a sample of the script:
[php]
<?php $file = $_POST['file']; $company = $_POST['company']; $ordered = $_POST['ordered']; $email = $_POST['email']; $date = $_POST['date']; $po = $_POST['po']; $requirements = $_POST['requirements']; /*products*/ $Product1 = $_POST['Product1']; $Product2 = $_POST['Product2']; /*TOTAL*/ $total = $Product1 + $Product2; /*Sending Email*/ $to = $_POST['to']; $subject = "Orders by $company"; $message = " FILE = $file Company = $company Ordered = $ordered Email = $email Date = $date PO = $po Requirements = $requirements PRODUCTS ---------------------------------------------- Product1 = $Product1 Product2 = $Product2 ----------------------------------------------------------- TOTAL PRODUCTS ORDERED = $total"; $headers = "From: $email\r\n"; $headers .= "Cc: $email\r\n"; if(mail($to, $subject, $message, $headers)) echo "Thank you for submitting your online Orders. A copy of the order has been sent to your email address. Please check all details are correct. |
[/php]