From: SourceForge.net <no...@so...> - 2008-09-14 22:51:19
|
/mod/mailinglists item #2109418, was opened at 2008-09-13 16:44 Message generated for change (Comment added) made by blindman1344 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=765094&aid=2109418&group_id=81360 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Defect Group: None Status: Open Resolution: None >Priority: 9 Private: No Submitted By: Chris (teliki) Assigned to: Greg Meiste (blindman1344) Summary: Does not generate emails Initial Comment: Hi there, I cannot get mailinglists to send email. When I subscribe it sets up the request on the proper list but the confirmation email is never sent. Similarly when I directly add an approved user and try to send out email it doesn't send anything. I checked that the php "mail" function works on my server (using a simple test script) and it works. The module looks perfect for our use - hope we can get it functioning. Thanks, Chris ho...@ya... ---------------------------------------------------------------------- >Comment By: Greg Meiste (blindman1344) Date: 2008-09-14 17:51 Message: Great analysis! I am indeed using the setFrom function as it wasn't intended. I have sent a request to the phpWebSite Development Team at ASU to see if they'll add composite from address support to the Mail class in their next release. In addition, I will address the Mailing Lists module issues you pointed out in my next release. Thanks again for all your help, and thanks for using the module! ---------------------------------------------------------------------- Comment By: Chris (teliki) Date: 2008-09-14 13:19 Message: I have figured out the problem - where should I (properly)post this? Please be kind on the newbie! The problem is that a composite "from" address is being built in /mod/mailinglists/Email.php line 306. This composite is being validated in the core/class/Mail.php checkAddress function - which appears to be designed to validate ONLY pure email addresses. In my case, the mailing list name contains an apostrophe and a period (abbreviation for Saint) i.e. the composite being built by line 306 above is "St. George's of Forest Hill <ho...@ya...>" - which fails the checkAddress rules. If I remove the period and comma from the list name, then all is well (except for poor grammar in the address of the sent emails). Also, when an address fails like this there is no mention i.e. you just get a "email sent" message back. I'm not that familiar with phpwebsite but it may be that the core mail class should be passed the senders name and email address separately - then it can check the email address and use it and the senders name to comopose the "from" parameter of the actual email? Should be corrected as it'll affect anyone using more than characters in their listname. Chris contains a period and an aprostro. This presents "St. George's of Forest Hill <ho...@ya...>" to the checkAddress function in core/Mail.php According to checkAddress only a single period can be present - which is valid if you are only checking an email address - but you are passing the composite containing name and email address. I can now get mailinglists to send properly if I remove the period in the from name of the mailing list. The problem was the fact this defaults to the site name - which uses "St." instead of "Saint". ---------------------------------------------------------------------- Comment By: Chris (teliki) Date: 2008-09-14 11:25 Message: Some progress. In the core Mail.php script, in the send function, the following code is finding $this->from_address) empty: if (empty($this->send_to) || empty($this->from_address) || ( empty($this->message_body) && empty($this->html_body) ) ) { return FALSE; } The false return is not handled, so the mailinglist module returns the message that "mail has been sent". If I comment out the code above, mail is sent - although without a from address... Now to figure out why the from address is empty - if you have any suggestions let me know. Chris ---------------------------------------------------------------------- Comment By: Chris (teliki) Date: 2008-09-14 11:00 Message: The post regarding this module (on the phpwebsite site itself) had a link to here for questions and comments. Sorry, I thought this was a question... Where should I be posting relating to this "third party module". Blindman 1344 - I followed through the send function in your Email.php class and everything looks good up until $mail->send(). $send_to = "ch...@ge..." $list->getFromName() = "Chris Holderness" $list->getFromEmail() = "ho...@ya..." $this->getSubject() = "Test subject" $this->getMsgText() = "test message text" $this->msg_html = "test message text with html tags $this->getListId() = 1 $subscriber is set $tpl_text['MESSAGE'] = "test message text" $tpl_text['FOOTER'] = proper footer messasge $mail->setMessageBody is correct (seeing template processed body data) $mail->setHTMLBody is correct html body data Unless you have any guidance my next step will be to dig into the core mail class and start working through it. As per the previous comment about this not being the palce for us to communicate, can we offline to my email ho...@ya... ? A few emails between us should nail this quickly. Thanks, Chris ---------------------------------------------------------------------- Comment By: Verdon Vaillancourt (verdonv) Date: 2008-09-14 10:30 Message: Guys, why don't you take this conversation to the forums here or at phpwsforums.com which I think is where the conversation should be. :) ---------------------------------------------------------------------- Comment By: Chris (teliki) Date: 2008-09-14 10:14 Message: Before you respond wait until I get back to you. I'm working through your Email.php class - send function. I'll confirm all the email data is being found and set up correctly. Chris ---------------------------------------------------------------------- Comment By: Chris (teliki) Date: 2008-09-14 10:03 Message: Forgot to mention - nothing is being written to the error log when I attempt to send. Chris ---------------------------------------------------------------------- Comment By: Chris (teliki) Date: 2008-09-14 10:02 Message: I have not modified anything except specifying (in Control panel) that anon users could subscribe. I am fairly proficient with php (but a little weak in OO design). Can you point me to specific scripts/clsses where I can set breaks and echo variables? When I create email for my test list it does come back with the message that email has been sent. It would save me a lot of time if you could let me know where the actual mail class is invoked and maybe a little info on the process/structure. Seems like a good place to start is confirmation the mail class is being invoked and what it's trying to send - then work backward from there. I really appreciate your fast response to these comments - thanks! Chris ---------------------------------------------------------------------- Comment By: Greg Meiste (blindman1344) Date: 2008-09-14 08:26 Message: That is strange since the Users module and the Mailing Lists module both use phpWebSite's core Mail class for sending email. Did you modify any of the Mailing Lists default settings? Do you see any error messages in logs/error.log? ---------------------------------------------------------------------- Comment By: Chris (teliki) Date: 2008-09-14 07:56 Message: Forgot to add that I can send email via other phpwebsite functions. For example if I add a new user and click "send email notification", the email is sent and received. The mail settings in config/core/mail_settings.php is set to "define('MAIL_BACKEND', 'mail');" ---------------------------------------------------------------------- Comment By: Greg Meiste (blindman1344) Date: 2008-09-13 19:38 Message: Do you receive any emails from other phpWebSite modules? Because the Mailing Lists module uses the phpWebSite core mail class, chances are something may be misconfigured in the core. Please double check your mail settings in config/core/mail_settings.php and modify if necessary. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=765094&aid=2109418&group_id=81360 |