[lib] ajout des fichiers non suivis
darcs-hash:20090609134320-bd074-f4df3e57ff2a6e60f07e25cda773524c8e20de3c.gz
This commit is contained in:
parent
dce8ccb6da
commit
c2535c1f04
17 changed files with 2346 additions and 0 deletions
25
lib/mail/__init__.py
Normal file
25
lib/mail/__init__.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
"""
|
||||
__init__.py
|
||||
|
||||
Fonction de base pour les mails.
|
||||
|
||||
Copyright (c) 2006 by www.crans.org
|
||||
"""
|
||||
|
||||
SENDMAIL = "/usr/sbin/sendmail" # sendmail location
|
||||
|
||||
def quickSend(From=None, To=None, Subject=None, Text=None, disconnect_on_bounce=0):
|
||||
"""envoie d'un mail"""
|
||||
OPTIONS = ' -t' #extract recipient from headers
|
||||
if disconnect_on_bounce:
|
||||
OPTIONS+= ' -V -f bounces'
|
||||
from os import popen
|
||||
p = popen("%s -t %s" % (SENDMAIL, OPTIONS), "w")
|
||||
p.write("From: %s\n" % From)
|
||||
p.write("To: %s\n" % To)
|
||||
p.write("Subject: %s\n" % Subject)
|
||||
p.write("\n") # blank line separating headers from body
|
||||
p.write("%s\n" % Text)
|
||||
sts = p.close()
|
||||
if sts:
|
||||
print "Sendmail exit status", sts
|
Loading…
Add table
Add a link
Reference in a new issue