473,699 Members | 2,801 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 1507

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 read some where that some times, it is possible to attach without detaching, if the data and log...
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 double-checked my username/passwords as well trying to actually login from the web and with two...
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 I want to attach and then run the website that uses it. This is a .mdf file from wrox books. ...
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. He wanted to use this so he could attach quotes as a .pdf instead, which I have built an...
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 fine. The error I get is "HTTP Error 400: Bad Request" when using gmailAccount.login(). This...
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 IE 6.0 , IE 7.0 , opera 9.20 but ended with no success .
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 not working. It is reading only first file for attachment purposes and ignores second one.I would...
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 created in the database. I have been searching the net and found many methods but none of them are...
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.