Avatar of Robert Granlund
Robert Granlund
Flag for United States of America asked on

PHP Mail error

I am sending PHP mail but I am getting an error from the server and the emails are being Quarantined.

Here is what I have:
<?php
$headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-Type: text/html; charset=UTF-8' . "\r\n";
		
	$headers .= 'To: '.$to."\r\n";
	$headers .= 'From: '.$from."\r\n".' Return-Path: '.$from."\r\n";
	
	@mail($to, $subject, $message, $headers);

Open in new window

These are two of the errors.  Please look at the return path.
Console_2017-03-08_15-15-17.png
Console_2017-03-08_15-21-41.png
PHP

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon
SOLUTION
hielo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dave Baldwin

Yes to both of those suggestions.  Email header items must start at the first character on the line and your email server is complaining about duplicate 'To:' lines.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23