I am sending a contact form response through PHP, respectively PHPmailer. It is sent from VPS with Debian & ISPConfig & Apache installed. The email is sent fine, Gmail recives it with no problem. However when I open the "original mail code" there is a wrong sender email:
Return-Path: <[email protected]>
resulting in SPF notice:
google.com: [email protected] does not designate permitted sender hosts
This of course causes some other web-mail providers not to recive this email.
I've looked through php.ini and some other configs but I could not find where would I set this.
Is it possible to change this through the PHPmailer (best option)? (or at least in some PHP-way?)
Or do I have to set it somewhere on the server-option side - if so - where?
EDIT:
I've managed to change the address itself through $mail->Sender = [email protected];
but it still does not designate
EDIT2 - partial solution:
The previous EDIT solves the problem with email providers not recieving the emails - now it comes with no problem, however I would still like to solve where to set the SPF properly so I would solve the designation problem.
The web1@server1 looks like something from ISP Config for the default user.
Try:
$headers.="Return-Path:[email protected]\r\n";
in your php ... the need to be greater and lesser signs around themail adress ... but I can not get them to display here.
Nicer would be checking the ISP Config Manual ... I am definately sure you are not the first to use that panel and have that problem. Changing or adding to the php.ini is not advised as this would change it for ALL users.