Recent Posts
Lua | 12 sec ago
None | 22 sec ago
None | 29 sec ago
C | 34 sec ago
Lua | 43 sec ago
C | 49 sec ago
PHP | 54 sec ago
None | 55 sec ago
Lua | 56 sec ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By goobsoft on the 19th of Oct 2008 04:18:46 PM
Download |
Raw |
Embed |
Report
# Upload Images to SmugMug
import smtplib
import os
import sys
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEImage import MIMEImage
for root, dirs, files in os.walk('.'):
for filename in files:
msg = MIMEMultipart()
msg['From'] = 'accout@gmail.com'
msg['To'] = 'user@email.smugmug.com'
msg['Subject'] = 'password'
attach = MIMEImage(file(os.path.join(root, filename)).read())
# SmugMug Requires a fileName
attach.add_header('Content-Disposition', 'attachment', filename=filename)
msg.attach(attach)
print "Sending %s." % filename,
server = smtplib.SMTP('email.smugmug.com')
#server.set_debuglevel(1)
# Must use as_string for it to work right
server.sendmail("account@gmail.com", "user@email.smugmug.com", msg.as_string())
server.quit()
print "Sent"
#sys.exit(1)
Submit a correction or amendment below.
Make A New Post