Hi! At 0:19 Uhr -0500 16.02.2000, R. David Murray wrote:
On Wed, 16 Feb 2000, Jochen Haeberle wrote:
I have a property to a ZClass that defines the mailhost to be used for the instance. The property is called use_mailhost.
Now I am working on a method that is to make use of this property, but I can't get it to work:
<dtml-sendmail mailhost="_[use_mailhost]">
I'm guessing that the problem here is that the 'mailhost' parameter is expecting a mailhost *object*, but that you are trying to reference a string property. To do that, you'd want to use the 'smtphost' parameter.
Yes, you are right, I guess that has to do with the problem, but I am not through, yet... About the same problem happens when I use smtphost (changing the value of my string property accordingly!): Error Type: error Error Value: host not found <!-- Traceback (innermost last): File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 179, in publish File /serve/MIS-Zope-2.1.3/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: Cat3) File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 165, in publish File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: email_photo) File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: email_photo) File /serve/MIS-Zope-2.1.3/lib/python/OFS/DTMLMethod.py, line 145, in __call__ (Object: email_photo) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: email_photo) File /serve/MIS-Zope-2.1.3/lib/python/Products/MailHost/SendMailTag.py, line 189, in render (Object: _.getvalue(PhotoAlbum_Mailhost)) File /serve/MIS-Zope-2.1.3/lib/python/Products/MailHost/MailHost.py, line 206, in send (Object: ) File /serve/MIS-Zope-2.1.3/lib/python/Products/MailHost/MailHost.py, line 253, in __init__ error: (see above) --> Even if it worked, it would not be what I want. I would like to have a string property to my ZClass that refers to an Mailhost object. I know this is not that easy, but as far as I know, the object that is referred to by the string object should be callable as _.getitem('my_mailhost') but it does not work... my_mailhost contains a vaild smtp hostname. Could someone please give me a clue??? Jochen