(2012-11-13) Html Email Sent By Code Showing Tags In Gmail
Since Simplest Thing has few users so far, I'm just sending a weekly user-nudge-email (as HtmlEmail) via my GMail account per the WebPy documentation.
It works fine from my dev machine.
But when sent by production users see the raw HTML (tag soup).
Top of a "good" email: {{{ Message-ID: 50a26c51.c49a320a.1126.02e3@mx.google.com Date: Tue, 13 Nov 2012 07:50:41 -0800 (PST) Content-Transfer-Encoding: 7bit Content-Disposition: inline To: fluxent+newfam@gmail.com MIME-Version: 1.0 Content-Type: text/html; charset="utf-8" From: bill@simplest-thing.com Subject: Your nudging email about Family 'new fam' from Simplest Thing X-Gm-Message-State: ALoCoQnGvB/h5Fd465LT2yiD0KNC4nDo18GEH1pXdg5Fwc2HSuAyKg0D+IpudgBnC/7S9ucGLh8B
Here's your nudging email from Family Financial Future about the open tasks you have for family 'new fam'.
}}}Vs a "bad" email: {{{ Message-ID: 50a26dd5.21adec0a.7cc4.ffffc8d9@mx.google.com Date: Tue, 13 Nov 2012 07:57:09 -0800 (PST) Content-Transfer-Encoding: 7bit Content-Disposition: inline MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To: fluxent+20121026d@gmail.com Content-Type: text/html;charset=utf-8 From: bill@simplest-thing.com Subject: Your nudging email about Family 'newfam' from Simplest Thing X-Gm-Message-State: ALoCoQlL5eBR6RRzf1ULot0TuoKFSGX8rnyjgzVF7I2BRsWI+BsTdT+RbVc6/s9D2s3tPNH+tjVE
Here's your nudging email from Family Financial Future about the open tasks you have for family 'newfam'.
}}}Note the differing Content-Type header tags, and the fact that the "bad" email has 2 sets.
Some possibilities that come to mind:
- different versions of WebPy?
- on server, web is in both {{{
/usr/lib/pymodules/python2.7/web
/usr/share/pyshared/web
}}}
- both show v 0.34 - [ack that's](https://github.com/webpy/webpy/blob/master/Change Log.txt) really old!
- ah, my dev version is 0.36
- sendmail is in
utils.py
- there are definitely changes in the sendmail code between versions!
- on server, web is in both {{{
/usr/lib/pymodules/python2.7/web
/usr/share/pyshared/web
}}}
Try apt-get since that's how I installed WebPy on this machine. It says I have latest version. But that's obviously not true - latest version is actually 0.37 (newer than my dev system). If I do easy_install, will it find and update over the version installed by apt-get, or stick things in a totally new place and I'll have to worry about which one is getting used?
- Did
apt-get remove
of webpy - Did easy_install of webpy (had to download easy_install egg first, and wget had issues)
- killed/restarted wsgi - all seems to be running fine
Can't install v 0.37 on my dev machine without upgrading Python, too, so not in the mood to bother.
Tweak my email code to run across only my test accounts. Runs in production and sends me nicely HTML!
Edited: | Tweet this! | Search Twitter for discussion
No backlinks!
No twinpages!