Results 1 to 2 of 2

Thread: Version 5.5.2 Email.php email2ParseAddresses PHP Fatal error

  1. #1
    o2badad is offline Member
    Join Date
    Feb 2009
    Posts
    7

    Post Version 5.5.2 Email.php email2ParseAddresses PHP Fatal error

    I have custom modules which send email using Email.php in logic hooks. Currently using Sugar5.2.0.k CE on LAMP. I am testing for an upgrade to 5.5.2 and am finding my email fails for my custom modules. The line I am getting an error in is 256 of file modules/Email/Email.php in the upgrade version of 5.5.2 CE. I noticed a change in files from 5.2.0 to 5.5.2:

    //This is from 5.2.0k CE in Email.php
    function email2ParseAddresses($addresses) {
    $addresses = from_html($addresses);
    $addresses = str_replace(",", ";", $addresses);
    $exAddr = explode(";", $addresses);

    //This is from 5.5.2 CE in Email.php
    function email2ParseAddresses($addresses) {
    $addresses = from_html($addresses);
    $addresses = $this->et->unifyEmailString($addresses);

    $pattern = '/@.*,/U';
    preg_match_all($pattern, $addresses, $matchs);
    if (!empty($matchs[0])){
    $total = $matchs[0];
    foreach ($total as $match) {
    $convertedPattern = str_replace(',', '::;::', $match);
    $addresses = str_replace($match, $convertedPattern, $addresses);
    } //foreach
    }

    $exAddr = explode("::;::", $addresses);

    The error is in $addresses = $this->et->unifyEmailString($addresses);
    PHP Fatal error: Call to a member function unifyEmailString() on a non-object in
    .../crm-upgrade/modules/Emails/Email.php on line 256

    I found a comment for the declaration of the $et variable. It is the Email UI. Because I am not using the UI to send emails, what is the recommended way to do so now? Do I need to initialize this object just for that method to be used? If so, can I get an example to do so? Or, is there an alternative/preferred way to send email?

    Thanks in advance,
    Bryan

  2. #2
    o2badad is offline Member
    Join Date
    Feb 2009
    Posts
    7

    Default Re: Version 5.5.2 Email.php email2ParseAddresses PHP Fatal error

    Found the solution to initialize the object. Before I send the email, I call email2init(). This initializes that very object needed to unify the string.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Fatal error: Class 'Version' not found
    By srforce in forum Installation and Upgrade Help
    Replies: 3
    Last Post: 2009-10-06, 04:44 AM
  2. Fatal email error in sugarcrm.log
    By Cannon in forum Help
    Replies: 8
    Last Post: 2009-01-31, 12:01 AM
  3. eMail: fatal error
    By Thomasi in forum Help
    Replies: 0
    Last Post: 2006-09-27, 08:21 AM
  4. Fatal error sending email
    By ymartin in forum General Discussion
    Replies: 0
    Last Post: 2006-04-20, 04:04 PM
  5. Replies: 0
    Last Post: 2005-09-19, 10:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •