Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 27382 Details for
Bug 11359
[NEW FEATURE] pkg_postinst/pkg_preinst ewarn/einfo logging
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Python script to send file by e-mail (uses smtplib)
mailsend (text/plain), 855 bytes, created by
Nicolás Echániz
on 2004-03-14 16:37:28 UTC
(
hide
)
Description:
Python script to send file by e-mail (uses smtplib)
Filename:
MIME Type:
Creator:
Nicolás Echániz
Created:
2004-03-14 16:37:28 UTC
Size:
855 bytes
patch
obsolete
>#!/usr/bin/python > >import os, sys, smtplib > >def mailsend(messsage_file, sender, recipient, host, subject): > """sends a local file by e-mail from the sender to the recipient >using the specified (SMTP)host""" > > try: > file = open(message_file, "r") > except: > print "Could't read from message file", message_file > sys.exit() > > message = file.read() > file.close() > mail = """\ >From: %(sender)s >Subject: %(subject)s > >%(message)s >""" % locals() > > server = smtplib.SMTP(host) > server.set_debuglevel(0) > server.sendmail(sender, recipient, mail) > server.quit() > >if __name__=="__main__": > try: > message_file, sender = sys.argv[1], sys.argv[2] > recipient, host, subject = sys.argv[3], sys.argv[4], sys.argv[5] > > except: > print "Usage:\n mailsend filename sender recipient host subject" > sys.exit() > > mailsend(message_file, sender, recipient, host, subject)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 11359
:
6039
|
6046
|
16300
|
16341
|
25855
|
27224
| 27382 |
36713
|
36784
|
43541
|
65206