Where is encode in base64.py ?

EleKtR0 elektroQUITA at wol.es
Sun Mar 16 17:44:19 CET 2003


Hi!
I'm trying create a simple mail client with Python, but i have this message 
when run my program:

Traceback (most recent call last):
  File "./enviar_cv.py", line 5, in ?
    from smtplib import SMTP
  File "/usr/local/lib/python2.3/smtplib.py", line 47, in ?
    import base64
  File "/home/jasm/Programacion/base64.py", line 6, in ?
    base64.encode(f_in,f_out)
AttributeError: 'module' object has no attribute 'encode'


Source code:

#! /usr/bin/env python

from smtplib import SMTP
import quopri
import base64

correo=SMTP

entrada=open("enviar_cv.py","r")
salida=open("enviar_salida.mime","w")

base64.encode(entrada,salida)

entrada.close
salida.close

texto=quopri.encodestring("FROM:Elektro")
texto=texto + "Subject:Probe" + "\r\n"
correo.sendmail("i at probe.com","i at probe.com",texto)



Thanks!




More information about the Python-list mailing list