[Twisted-Python] Sent e-mails coming up empty

Laurens Van Houtven _ at lvh.cc
Wed Oct 5 16:56:26 EDT 2011


Eek!

As Stephen somewhat tongue-in-cheekly pointed out, this was fixed by rewinding the StringIO ;)

cheers
lvh



On 05 Oct 2011, at 22:46, Thorne, Stephen wrote:

> Have you tried rewinding the stringio with .seek(0,0) first?
> 
> Stephen
> 
> On Wed, Oct 5, 2011 at 21:34, Laurens Van Houtven <_ at lvh.cc> wrote:
> Hey,
> 
> 
> I've hacked some code together based on smtpclient_tls.py and radix's article on how to send e-mail: http://radix.twistedmatrix.com/2010/07/how-to-send-good-unicode-email-with.html
> 
> Here's what I've come up with: http://paste.pocoo.org/show/487918/
> 
> The e-mail arrives, but it's as if the body is empty. The from address is wrong (it uses my login email), there's no subject, no body... I've pointed my debugger at the problem, but the repr looks pretty okay: 
> 
> 'Content-Type: multipart/alternative;\n boundary="===============6076587290379738777=="\nMIME-Version: 1.0\nSubject: Content Access\nTo: _ at lvh.cc\nFrom: dc83518c-4eea-447f-a9d8-29e29022e6f8 at myotherdomain.com\n\n--===============6076587290379738777==\nMIME-Version: 1.0\nContent-Type: text/html; charset="utf-8"\nContent-Transfer-Encoding: quoted-printable\n\n<html>\n<body>\nOh hello!!!!!\n</body>\n</html>\n--===============6076587290379738777==\nMIME-Version: 1.0\nContent-Type: text/plain; charset="utf-8"\nContent-Transfer-Encoding: quoted-printable\n\n\nOh hello!!!!!\n\n--===============6076587290379738777==--'
> 
> How do I go about debugging this further?
> 
> 
> cheers
> lvh
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1306 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20111005/0b8faa20/attachment.bin 


More information about the Twisted-Python mailing list