Avatar of Robert Granlund
Robert GranlundFlag 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
SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Blurred text
THIS SOLUTION IS 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
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Blurred text
THIS SOLUTION IS 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.
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

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.
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo