Update v_mailto.php

Add ability to define the hostname used when sending mail.
This commit is contained in:
Nate 2018-11-28 23:00:12 -07:00 committed by GitHub
parent 62f392aed3
commit f0594c8279
1 changed files with 6 additions and 0 deletions

View File

@ -135,6 +135,9 @@
//prepare smtp server settings
// load default smtp settings
if ($_SESSION['email']['smtp_hostname']['text'] != '') {
$smtp['hostname'] = $_SESSION['email']['smtp_hostname']['text'];
}
$smtp['host'] = (strlen($_SESSION['email']['smtp_host']['text'])?$_SESSION['email']['smtp_host']['text']:'127.0.0.1');
if (isset($_SESSION['email']['smtp_port'])) {
$smtp['port'] = (int)$_SESSION['email']['smtp_port']['numeric'];
@ -210,6 +213,9 @@
}
$mail->SMTPAuth = $smtp['auth'];
if (isset($smtp['hostname'])) {
$mail->Hostname = $smtp['hostname'];
}
$mail->Host = $smtp['host'];
if ($smtp['port']!=0) $mail->Port=$smtp['port'];
if ($smtp['secure'] != '') {