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

Home Posts Topics Members FAQ

libgmail: attaching files

wal
How does one attach files to emails using libgmail? The following code
http://pramode.net/articles/lfy/fuse/4.txt
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,
wal

----------------------------------
Traceback (most recent call last):
File "C:\Documen ts and
Settings\lucp17 35\Desktop\libg mail-0.1.5.1\knujon. py", line 24, in <module>
if ga.sendMessage( fs):
File "C:\Documen ts and
Settings\lucp17 35\Desktop\libg mail-0.1.5.1\libgmai l.py", line 582, in
sendMessage
msgStr = mimeMessage.as_ string()
File "C:\program files\Python25\ lib\email\messa ge.py", line 131, in
as_string
g.flatten(self, unixfrom=unixfr om)
File "C:\program files\Python25\ lib\email\gener ator.py", line 84, in
flatten
self._write(msg )
File "C:\program files\Python25\ lib\email\gener ator.py", line 109, in
_write
self._dispatch( msg)
File "C:\program files\Python25\ lib\email\gener ator.py", line 135, in
_dispatch
meth(msg)
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
flatten
self._write(msg )
File "C:\program files\Python25\ lib\email\gener ator.py", line 109, in
_write
self._dispatch( msg)
File "C:\program files\Python25\ lib\email\gener ator.py", line 135, in
_dispatch
meth(msg)
File "C:\program files\Python25\ lib\email\gener ator.py", line 266, in
_handle_message
g.flatten(msg.g et_payload(0), unixfrom=False)
File "C:\program files\Python25\ lib\email\messa ge.py", line 185, in
get_payload
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

1
3235
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...
0
2472
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...
4
5239
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...
3
3094
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
2
2308
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....
10
2229
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...
8
19223
AmberJain
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...
3
5939
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...
4
5148
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...
0
7596
marktang
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...
0
7798
Oralloy
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. ...
0
8039
jinu1996
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...
0
6140
agi2029
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...
0
5152
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...
0
3556
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...
1
2015
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
1
1130
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
838
bsmnconsultancy
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.