using smtp sent large file upto 60MB

moonhkt moonhkt at gmail.com
Tue Dec 4 09:15:22 CET 2012


Hi All

How to using python send file uptp 60MB ?


s = smtplib.SMTP("localhost")
#~~ s.set_debuglevel(1)
s.sendmail(from_addr, to_addr,m.as_string())
s.quit


For 13MB file have below error
    s.sendmail(from_addr, to_addr,m.as_string())
  File "/opt/freeware/lib/python2.6/email/message.py", line 135, in
as_string
    g.flatten(self, unixfrom=unixfrom)
  File "/opt/freeware/lib/python2.6/email/generator.py", line 84, in
flatten
    self._write(msg)
  File "/opt/freeware/lib/python2.6/email/generator.py", line 119, in
_write
    self._fp.write(sfp.getvalue())
MemoryError: out of memory



More information about the Python-list mailing list