<?php

try {
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

	
	$stmt = $conn->prepare("SELECT * FROM tbl_smtp");
	$stmt->execute();
	$result = $stmt->fetchAll();

    foreach($result as $row)
    {
        $mail_server = $row[0];
        $mail_username = $row[1];
        $mail_password = $row[2];
        $mail_port = $row[3];
        $mail_type = $row[4];

		
	}				  
	}catch(PDOException $e)
    {
    echo "Connection failed: " . $e->getMessage();
    }


?>