from app import mysql

def get_company_smtp_settings(company_id):
    cursor = mysql.connection.cursor()
    cursor.execute("""
        SELECT mail_mailer, mail_host, mail_port, mail_username, mail_password,
               mail_encryption, mail_from_address, mail_from_name
        FROM company_settings
        WHERE company_id = %s
        """, (company_id,))
    settings = cursor.fetchone()
    cursor.close()
    return settings