Browse Source

ajoute une option very-verbose pour les trames smtp

master
François Poulain 8 months ago
parent
commit
2e6c786f4f
  1. 6
      mailing.py

6
mailing.py

@ -56,6 +56,9 @@ def parse_args():
parser.add_argument(
"-v", "--verbose", action="store_true",
)
parser.add_argument(
"-vv", "--very-verbose", action="store_true",
)
parser.add_argument(
"-a", "--attachement", type=str, nargs="+", help="Optionnal attachments.",
)
@ -157,7 +160,8 @@ def send_message(templates, data, attachments, args):
if not args.dry_run:
# sending the mail to its recipients using the local mailer via SMTP
server = smtplib.SMTP("localhost", "25")
server.set_debuglevel(1)
if args.very_verbose:
server.set_debuglevel(1)
server.send_message(msg)
server.quit()

Loading…
Cancel
Save