GO: Send E-Mail via SMTP mit AUTH
Um eine E-Mail mit GO zu versenden verwende ich das „go-smtp“ Package. https://github.com/wneessen/go-mail In diesem Snippet sind 2 Beispiele, einmal für SMTP via SSL und SMTP via TLS.
where do you want LAN bugs today?
Um eine E-Mail mit GO zu versenden verwende ich das „go-smtp“ Package. https://github.com/wneessen/go-mail In diesem Snippet sind 2 Beispiele, einmal für SMTP via SSL und SMTP via TLS.
Ich habe eine schöne Umsetzung gefunden auf Stackoverflow (Quelle: python – How to send email attachments? – Stack Overflow) um E-Mails mit Anhang zu versenden. Mail with attachment (python3) (github.com)
swaks – Swiss Army Knife SMTP, the all-purpose smtp transaction tester Unter Ubuntu/Debian lässt sich swaks einfach installieren: Hier ein paar einfache Testcases um verschiedene Einlieferungsverfahren zu testen: SMTP ohne Authentifizierung testen SMTP mit Authentifizierung (PLAIN) SMTP mit Authentifizierung (SMTPS auf Port 465) SMTP mit Authentifizierung (SUBMISSION auf Port 587)
#!/usr/bin/env python # -*- coding: utf-8 -*- import smtplib from email.mime.text import MIMEText def postmaster(mfrom, mto, msubject, message, smtphost): msg = MIMEText(message.encode(„utf-8“)) msg[‚Subject‘] = msubject msg[‚From‘] = mfrom msg[‚To‘] = mto s = smtplib.SMTP(smtphost) s.sendmail(msg[‚From‘], msg[‚To‘], msg.as_string()) s.quit()