I have 2 servers, one from work and another from personnel. On my personal server, with this code I send an email without problems but in the work server it needs to be complemented with certain credentials. How can I add to the Mail SMTP credentials function?
$header = "From: [email protected] \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
$mensaje = "Nombre: " . $nombre . ",\r\n";
$mensaje .= "Email: " . $mail . " \r\n";
$mensaje .= "Mensaje: " . $_POST['mensaje'] . " \r\n";
$mensaje .= "Enviado el " . date('d/m/Y', time());
$para = '[email protected]';
$asunto = 'FHR Tecoria - [' . $categoria . "]";
ini_set("SMTP","xxxxxx");
ini_set("smtp_port","25");
ini_set("sendmail_from","[email protected]");
mail($para, utf8_decode($asunto), utf8_decode($mensaje), $header);
PS: Avoid using PHPMailer