#0719 Keep getting Failure. Message could not be sent
I can't get the mail to work at all. I have an SMTP server without authentication (i have also tried with authentication). I have tried MailHost and SecureMailHost.
I get this error in the event log :
2008-03-19T10:00:36 WARNING IssueTrackerIssue Message could not be sent
Traceback (most recent call last):
File "C:\Zope\Instance\2.10.5\Products\IssueTrackerProduct\Issue.py", line 2305, in TellAFriend
self.sendEmail(msg, both, fr, subject, swallowerrors=False)
File "C:\Zope\Instance\2.10.5\Products\IssueTrackerProduct\IssueTracker.py", line 6616, in sendEmail
mailhost._send(fr, to, message.as_string())
AttributeError: _send
5 months and 2 weeks and 6 days old
Do you have a SecureMailHost or a normal MailHost?
Sorry, just now saw that you wrote "I have tried MailHost and SecureMailHost."
Perhaps something has change in Zope 2.10.5 in regards to the MailHost. Let me have a look.
I was unable to reproduce it from a new zope 2.10.5 install with normal MailHost. It sends just fine. Now going to try SecureMailHost.
hmm...that's weird. I have tried so many things i can't get it to work. I even wrote a small app in C# to test the SMTP server and that worked fine as well.
The thing is, the IssueTrackerProduct uses a private method of the MailHost which is a bit naughty but shouldn't be a problem. There's something out of whack with your MailHost instance.
Can you try to write a test script inside the issuetracker that tries to send an email. If you need help how to do that in DTML or Python SCript let me know.
yes i can try that but i have no knowledge what so ever of Zope, Python, and SCript. I only know C# so if u can provide me with a very simple script that can try the email thing and maybe with some debug information if it decides to fail so we can troubleshot it then i will try it out right away. thx
Create a DTML Method inside zope with this content:
<dtml-sendmail mailhost="MailHost"> To: Mihai_at_working-email-address_dot_com From: Mihai_at_also-working-but-different_._com Subject: Test to send email from within Zope This is a test email. </dtml-sendmail>
and view it. NB you have to change the email addresses to something sensible so you can test that it works.
Hi Peter,
Can you tell me where do i create the DHTML method ? Is that in the control panel or is it in a file ?
Mihai
Ok i think i figured out how to do that. i get this error :
Site Error
An error was encountered while publishing this resource.
Error Type: KeyError
Error Value: 'MailHost'
--------------------------------------------------------------------------------
Troubleshooting Suggestions
This resource may be trying to reference a nonexistent object or variable 'MailHost'.
The URL may be incorrect.
The parameters passed to this resource may be incorrect.
A resource that this resource relies on may be encountering an error.
For more detailed information about the error, please refer to the error log.
If the error persists please contact the site maintainer. Thank you for your patience.
and this error on the event log :
2008-03-25T12:21:17 ERROR Zope.SiteErrorLog http://portal.bkogc.com:8080/test
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module OFS.DTMLMethod, line 144, in __call__
- <DTMLMethod at /test>
- URL: http://portal.bkogc.com:8080/test/manage_main
- Physical Path: /test
Module DocumentTemplate.DT_String, line 476, in __call__
Module Products.MailHost.SendMailTag, line 110, in render
KeyError: 'MailHost
Create the DTML Method inside the issuetracker you've created.
About the error, it simply says that you don't have a MailHost to deliver your emails. Perhaps that's why the emails in the issuetracker didn't work.
I now get following :
2008-03-25T13:12:37 ERROR Zope.SiteErrorLog http://portal.bkogc.com:8080/Control_Panel/Prod.../IssueTrackerProduct/testEmail
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module OFS.DTMLMethod, line 144, in __call__
- <DTMLMethod at /Control_Panel/Products/IssueTrackerProduct/testEmail>
- URL: http://portal.bkogc.com:8080/Control_Panel/Prod...rProduct/testEmail/manage_main
- Physical Path: /Control_Panel/Products/IssueTrackerProduct/testEmail
Module DocumentTemplate.DT_String, line 476, in __call__
Module Products.MailHost.SendMailTag, line 114, in render
AttributeError: send
Weird! Now add a new DTML Method next to the existing one but with a different ID. Add this code:
<dtml-var "MailHost.meta_type"> <dtml-var "MailHost.absolute_url()">
There's something really strange about your mailhost. Are you sure you don't have some strange MailHost type of product installed in that Zope?
i now get :
Product
http://portal.bkogc.com:8080/Control_Panel/Products/MailHost
I have made a normal windows installation and then i created a Mailhost but the product itself was included in the installation.
Under products this is what it's says about MailHost :
MailHost (Installed product MailHost (MailHost-1-3-0))
Ah!! I see. You've created your instance inside Control_Panel. That explains it. You shouldn't.
Create the issuetracker in the Zope root and your problems will go away. The objects you see in /Control_Panel/Products/ are just there to represent what's been installed on the filesystem.
Yes sir :) that made it to work. I guess this is a common mistake for newbies like me :)
thx for the time and effort u put into this.
I've never actually heard anybody do that mistake before :)
Good luck using the issuetrackerproduct now. If you can please help out by sharing your story