I've run into an issue with MailHost returning a "No message recipients
designated" exception on an older Zope server that I've never seen before
and I can't quite figure out.

I created a simple SendMail template that looks similar to:

<dtml-sendmail mailhost="testmail">
To: t...@test.org
From: Test Email <te...@test.org>
Subject: Testing
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<dtml-in "testSQL.Test_SQL_Method(_.None,_)">
  <dtml-var testSQLVar missing="" null="">


The SQL method will pull a simple string from a table with Latin1 encoding,
however, always excepts with "No message recipients designated". If I
replace it with just a dash or nothing at all it will send the mail just
fine. After researching I believed this had to do with the encoding so I've
played around with different values (7bit, none, base64, quoted-printable,
etc) and they all send except what I have above.

I looked through MailHost.py and was able to change the send function to:
    def send(self, messageText, mto=None, mfrom=None, subject=None,
             encode=None, immediate=True):
        messageText, mto, mfrom = messageText, 'm...@test.org','t...@test.org'
#_mungeHeaders( messageText, mto, mfrom, subject)
        messageText = _encode(messageText, encode)
        self._send(mfrom, mto, messageText, immediate)

Note the commenting of _mungeHeaders() - this, in turn, sent just fine. I
just can't figure out why, out of the blue with no change in the method of
how this was created, that this one fails with seemingly fine data.

This server is running Zope 2.11.4 (win32) with a MySQL 5.1.40 connected
through ZMySQLDA 3.1.1

Any help is appreciated.

Thanks, JD
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to