WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 01-22-2012, 12:08 PM
starlingstm starlingstm is offline
Join Date: May 2011
Posts: 19
Sending an email from Vizard

I have a script that asks the user to fill out a form with fields such as name, class, instructor,...
The script creates a text file with this information and stores it in a folder.I would like to automatically e-mail this text file when the script is over.
I am using the code below:

# Import smtplib for the actual sending function
import smtplib

# Import the email modules we'll need
from email.MIMEText import MIMEText

# Open a plain text file for reading. For this example, assume that
# the text file contains only ASCII characters.
fp = open(file path+textFileName.txt, 'rb')
# Create a text/plain message
msg = MIMEText(

# me == the sender's email address
# you == the recipient's email address
msg['Subject'] = 'The contents of %s' % file path+textFileName.txt
msg['From'] = ''
msg['To'] = ''

# Send the message via our own SMTP server, but don't include the
# envelope header.
s = smtplib.SMTP()
s.sendmail(me, [you], msg.as_string())

I am getting this error:

Traceback (most recent call last):
File "<string>", line 11, in <module>
File "C:\Users\Stephanie\Documents\", line 72, in <module>
s = smtplib.SMTP('localhost')
File "C:\Program Files (x86)\WorldViz\Vizard4\bin\lib\", line 239, in __init__
(code, msg) = self.connect(host, port)
File "C:\Program Files (x86)\WorldViz\Vizard4\bin\lib\", line 295, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "C:\Program Files (x86)\WorldViz\Vizard4\bin\lib\", line 273, in _get_socket
return socket.create_connection((port, host), timeout)
File "C:\Program Files (x86)\WorldViz\Vizard4\bin\lib\", line 571, in create_connection
raise err
socket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions

Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Realistic Light and Shadows Using Vizard and 3DS Max jde Vizard 4 07-13-2012 11:58 AM
Sending data to Vizard via UDP rlh001 Vizard 1 04-05-2011 05:14 PM
Vizard 4 Beta Testing farshizzo Announcements 0 02-01-2011 11:46 AM
Vizard 4 Beta Testing farshizzo Vizard 0 02-01-2011 11:46 AM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 12:13 PM

All times are GMT -7. The time now is 12:19 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC