[Tutor] Problem

Michael Long mlong@datalong.com
Fri Aug 1 19:34:02 2003


I am currently doing something similar without the attachement. The
following should get you started.

import smptlib
from email.MIMETest import MIMEText
msg = "The is the message in the body of the email"
msg = MIMEText(msg)
msg['Subject'] = "This is the subject line"
msg['From'] = "me@mydomain.com" # you will need the smtp email address 
                                # of your outlook account
msg['To'] = "someone@somewhere.com"
s = smtplib.SMTP("myOutlookServer")
s.login("mylogin", "mypasswd")
s.sendmail("me@mydomain.com",["someone@somewhere.com"],msg.as_string())
s.quit

> 
> Hello,
>  
>  I want to write a script which should do the following things:
>  
> - Read email address from a file and place it in the To address bar.
> - Print Hello in the Subject bar.
> - Access a file from a directory and attach it to th email.
> - Read a text file and copy the message in the text file and copy it
in the message area of the email.
> - Save it in the outlook box.
>  
> The outlook box then sends over the email to the email address specified.
>  
> Can I achieve these using Python scripting.. If yes how can we achieve
it... I am very new to Python language.. practically know nothing about
its syntax etc.
>  
> Can anybody suggest how to start it and how to achieve the above
task.... I would greatly appreciate if anybody can help me in this regard..
>  
> Thankx,
>  
> Vijayram Gopu.
>  
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
>