473,915 Members | 5,929 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 1523

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

Similar topics

1
3251
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...
0
2485
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...
4
5250
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. ...
3
3110
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
2325
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...
10
2253
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...
8
19243
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 IE 6.0 , IE 7.0 , opera 9.20 but ended with no success .
3
5967
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...
4
5160
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...
0
10039
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9883
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11359
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10928
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11069
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,...
0
10543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8102
isladogs
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...
1
4779
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
2
4346
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.