Adds support for custom smtp servers
This commit is contained in:
@@ -10,16 +10,15 @@ if (array_key_exists("mail", $OGPOST) and array_key_exists("sender", $OGPOST) an
|
||||
// Server Settings
|
||||
$mail->SMTPDebug = 0; // Prevents debugging
|
||||
$mail->isSMTP(); // Enables SMTP
|
||||
$mail->Host = 'smtp.sendgrid.net'; // Specify SMTP server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
// Gets the neccessary password for the credentials
|
||||
// Gets the smtp server data
|
||||
$jsonInfo = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/config.json");
|
||||
$jsonData = json_decode($jsonInfo, true);
|
||||
$password = $jsonData["mail"];
|
||||
$mail->Username = 'apikey'; // SMTP username
|
||||
$mail->Password = $password; // SMTP password
|
||||
$mail->Host = $jsonData["mail"]["server"]; // Specify SMTP server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $jsonData["mail"]["username"]; // SMTP username
|
||||
$mail->Password = $jsonData["mail"]["password"]; // SMTP password
|
||||
$mail->SMTPSecure = 'tls';//PHPMailer::ENCRYPTION_STARTTLS; Enable TLS encryption, `PHPMailer::ENCRYPTION_SMTPS` also accepted
|
||||
$mail->Port = 587; // TCP port to connect to
|
||||
$mail->Port = $jsonData["mail"]["port"]; // TCP port to connect to
|
||||
// Message content
|
||||
$mail->isHTML(true); // Set email format to HTML
|
||||
$mail->Subject = $OGPOST["subject"]; // The subject
|
||||
|
||||
@@ -65,7 +65,7 @@ try:
|
||||
developmentMachine = False
|
||||
configuration = {
|
||||
"api": os.getenv("WEBSITE_API"),
|
||||
"mail": os.getenv("MAIL_PASSWORD"),
|
||||
"mail": { "server": os.getenv("MAIL_SMTP_SERVER", "smtp.sendgrid.net"), "username": os.getenv("MAIL_USERNAME", "apikey"), "passsword": os.getenv("MAIL_PASSWORD", "none"), "port": int(os.getenv("MAIL_SMTP_PORT", "587")) },
|
||||
"database": { "username": os.getenv("WEBSITE_USER", "admin"), "name": os.getenv("WEBSITE_DATABASE_TABLE", "website"), "password": os.getenv("WEBSITE_PASSWORD", "password"), "backupLocation": os.getenv("WEBSITE_BACKUP_LOCATION", "/backup"), "backupLength" : int(os.getenv("WEBSITE_BACKUP_LENGTH", "604800")) },
|
||||
"developer": developmentMachine,
|
||||
"throttle": int(os.getenv("WEBSITE_THROTTLE", "5")),
|
||||
|
||||
Reference in New Issue
Block a user