473,554 Members | 3,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

libgmail: attaching files

How does one attach files to emails using libgmail? The following code
works fine when said files are simple text files, but it failes as soon as
the files are wild binary files, even attaching the source of an email in a
text file (.eml files) failes.
What am I missing here? Any hints?
The output I get when attemting to send binary files using the code above
is pasted below.

have fun,

Traceback (most recent call last):
File "C:\Documen ts and
Settings\lucp17 35\Desktop\libg mail-\knujon. py", line 24, in <module>
if ga.sendMessage( fs):
File "C:\Documen ts and
Settings\lucp17 35\Desktop\libg mail-\libgmai l.py", line 582, in
msgStr = mimeMessage.as_ string()
File "C:\program files\Python25\ lib\email\messa ge.py", line 131, in
g.flatten(self, unixfrom=unixfr om)
File "C:\program files\Python25\ lib\email\gener ator.py", line 84, in
self._write(msg )
File "C:\program files\Python25\ lib\email\gener ator.py", line 109, in
self._dispatch( msg)
File "C:\program files\Python25\ lib\email\gener ator.py", line 135, in
File "C:\program files\Python25\ lib\email\gener ator.py", line 201, in
_handle_multipa rt
g.flatten(part, unixfrom=False)
File "C:\program files\Python25\ lib\email\gener ator.py", line 84, in
self._write(msg )
File "C:\program files\Python25\ lib\email\gener ator.py", line 109, in
self._dispatch( msg)
File "C:\program files\Python25\ lib\email\gener ator.py", line 135, in
File "C:\program files\Python25\ lib\email\gener ator.py", line 266, in
g.flatten(msg.g et_payload(0), unixfrom=False)
File "C:\program files\Python25\ lib\email\messa ge.py", line 185, in
raise TypeError('Expe cted list, got %s' % type(self._payl oad))
TypeError: Expected list, got <type 'str'>
Oct 4 '06 #1
0 1500

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Ravi | last post by:
Q1.)In SQL Server 2000, is it always possible to use copies of the data and transaction log files of a database from one server to reattach to a new database on another server, or even to the same server, without first detaching from the existing database? Books Online says that detaching a database closes the data and log files cleanly. I...
by: kevincw01 | last post by:
There doesnt seem to be a reliable support channel for libgmail so i figured this group might have some people who could help. I have the latest version(from cvs) of libgmail.py, lgconstants.py and mkconstants.py with python version 2.3.3. gmailfs fails with a login error. I also tried a test login script and it fails on logon also. I...
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at below). Please help me get through this!!! I'm having some serious problems attaching a .mdf file and accessing it. I have a WroxUntied.mdf that...
by: linuxfreak | last post by:
hi guys, just starting out on python and libgmail... any documentation for libgmail outthere... basically what i want to do is develop an application to use gmail like and ftp server... should be able to upload files and download them as well.... thanks
by: ARC | last post by:
(sorry for the re-post, but I thought I would put the winmail.dat where it's visible in the subject...thanks!) Hello all, I have a question that I hope someone can help with. I have an Access 97 App, and I allow the user 2 options for e-mailing: MSMapi and MS Outlook 2000/XP. I have a user who is having trouble with the MS Outlook option....
by: james.p.news | last post by:
Hey all, I've been using libgmail to send out automated notification emails for my company's nightly regression testing. Last night these emails started failing, though the python code has not changed. I updated to the latest libgmail, but that isn't helping. I've logged in to the email account directly, and the account is still working...
by: AmberJain | last post by:
I'm having an mail account on yahoo mail. I formatted my HDD 3 days ago and reinstalled windows XP professional SP2. My problem is that I'm unable to attach any files to any of outgoing mail in my yahoo mail account. The progress bar of yahoo "file attaching" operation just progress for infinite time without attaching anything. I tried this with...
by: zaxxon25 | last post by:
I am having an issue with attaching 2 attachments one xip and other excel file with email and sending using perl sendmail. I tried to look on various forums and everywhere i get advice using MIME :: Lite. Unfortunately i cannot use it . I have tried to write a program on my own to send 2 attachments and sending using perl sendmail but program is...
by: jay123987 | last post by:
Morning / Afternoon / Goodday All, I was hoping someone can help me in understanding the best way to attach files to a access 2003 form. I have a database which is used to log phone calls and emails frm customers. When a customer emails and we make a record of this in the database using a form,we then need to attach the email to the record...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.