<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wiki.bdsa.dev/index.php?action=history&amp;feed=atom&amp;title=Envoi_d%27email_avec_Python</id>
	<title>Envoi d&#039;email avec Python - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bdsa.dev/index.php?action=history&amp;feed=atom&amp;title=Envoi_d%27email_avec_Python"/>
	<link rel="alternate" type="text/html" href="https://wiki.bdsa.dev/index.php?title=Envoi_d%27email_avec_Python&amp;action=history"/>
	<updated>2026-09-11T02:44:50Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://wiki.bdsa.dev/index.php?title=Envoi_d%27email_avec_Python&amp;diff=15&amp;oldid=prev</id>
		<title>David le 22 novembre 2023 à 13:21</title>
		<link rel="alternate" type="text/html" href="https://wiki.bdsa.dev/index.php?title=Envoi_d%27email_avec_Python&amp;diff=15&amp;oldid=prev"/>
		<updated>2023-11-22T13:21:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 22 novembre 2023 à 15:21&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l44&quot;&gt;Ligne 44 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 44 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     print(e)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     print(e)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Catégorie:Python]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>David</name></author>
	</entry>
	<entry>
		<id>https://wiki.bdsa.dev/index.php?title=Envoi_d%27email_avec_Python&amp;diff=14&amp;oldid=prev</id>
		<title>David : Création de la page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bdsa.dev/index.php?title=Envoi_d%27email_avec_Python&amp;diff=14&amp;oldid=prev"/>
		<updated>2023-11-22T13:20:05Z</updated>

		<summary type="html">&lt;p&gt;Création de la page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Ce script fonctionnant sous Python3 utilise des paramêtres de configuration SMTP d&amp;#039;ovh pour envoyer un message par email.&amp;lt;syntaxhighlight lang=&amp;quot;python3&amp;quot;&amp;gt;&lt;br /&gt;
import smtplib&lt;br /&gt;
from email.message import EmailMessage&lt;br /&gt;
&lt;br /&gt;
_username = &amp;#039;**@xpres.fr&amp;#039;&lt;br /&gt;
_password = &amp;#039;*****&amp;#039;&lt;br /&gt;
_host = &amp;#039;ssl0.ovh.net&amp;#039;&lt;br /&gt;
_port = 587&lt;br /&gt;
_subject = f&amp;#039;Text : {textfile}&amp;#039;&lt;br /&gt;
&lt;br /&gt;
_from = _username&lt;br /&gt;
_reply_to = &amp;quot;*****@****&amp;quot;&lt;br /&gt;
_to = &amp;quot;*****@****&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_content = &amp;quot;Contenu du message&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print(&amp;#039;Initiating email sending...&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
print(  f&amp;#039;From : {_from}\n&amp;#039;&lt;br /&gt;
        f&amp;#039;To : {_to}\n&amp;#039;&lt;br /&gt;
        f&amp;#039;Subject : {_subject}\n&amp;#039;&lt;br /&gt;
        f&amp;#039;Host : {_host}\n&amp;#039;&lt;br /&gt;
        f&amp;#039;Port : {_port}\n&amp;#039;&lt;br /&gt;
        f&amp;#039;Username : {_username}\n&amp;#039;&lt;br /&gt;
        f&amp;#039;Reply-To : {_reply_to}\n&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
msg = EmailMessage()&lt;br /&gt;
msg.set_content(_content)&lt;br /&gt;
&lt;br /&gt;
msg[&amp;#039;Subject&amp;#039;] = _subject&lt;br /&gt;
msg[&amp;#039;From&amp;#039;] = _from&lt;br /&gt;
msg[&amp;#039;Reply-To&amp;#039;] = _reply_to&lt;br /&gt;
msg[&amp;#039;To&amp;#039;] = _to&lt;br /&gt;
&lt;br /&gt;
try:&lt;br /&gt;
    # Send the message via our own SMTP server.&lt;br /&gt;
    s = smtplib.SMTP(_host, _port)&lt;br /&gt;
    s.login(_username, _password)&lt;br /&gt;
    s.send_message(msg)&lt;br /&gt;
    s.quit()&lt;br /&gt;
    print(&amp;quot;Successfully sent email&amp;quot;)&lt;br /&gt;
except Exception as e:&lt;br /&gt;
    print(e)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>David</name></author>
	</entry>
</feed>