Extra key-value pairs in parameters for email



examples/functions/extra_key_value_pairs.py
def sendmail(From, To, Subject, Content, **header):
    print('From:', From)
    print('To:', To)
    print('Subject:', Subject)
    for field, value in header.items():
        print(f"X-{field}: {value}")
    print('')
    print(Content)

sendmail(
    Subject = 'self message',
    Content = 'Has some content too',
    From = 'gabor@szabgab.com',
    To = 'szabgab@gmail.com',

    mailer = "Python",
    signature = "My sig",
)

From: gabor@szabgab.com
To: szabgab@gmail.com
Subject: self message
X-mailer: Python
X-signature: My sig

Has some content too