php mail function smtp settings
snippet in php

php mail function smtp settings

user4024

//Setup the SMTP server settings !
//INI Setup not needed on Linux when sendmail or postfix is installed
//mail DOES not support AUTH - USE ONLY WITH OPEN RELAY
ini_set("SMTP", "smtp.example.com");
ini_set("smtp_port", 25);
ini_set("sendmail_from", "info@example.com");

//DO NOT WASTE TIME SETTING THESE BELOW FOR AUTH - JUST USE PHP MAILER
/*
auth_username = username 
auth_password = password 
OR
username = username 
password = password 
*/


$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

$headers .= 'From:No Reply<noreply@example.com>' . "\r\n";
$headers .= 'Reply-To:Info<info@example.com>' . "\r\n";
$headers .= 'Cc:Carbon<carbon@example.com>' . "\r\n";


mail("test@test.com", "Subject", "Hello World!", $headers);