How to Automatically Create SugarCRM Cases From Inbound Emails


Need to configure SugarCRM to automatically create cases from emails.
An example scenario is to have cases automatically created for all emails that go to your support email address.


Note: The email functionality changed significantly in Sugar 5.5.1. For detailed information, see the  Sugar Application Guide for 5.5.1 or later versions.


  • You need to have Administrative privileges.
  • In Sugar Enterprise and Professional, teams need to be configured. For help on configuring Teams check the Installation and Administration Guide (for Sugar 5.2.0 and earlier versions) or the Sugar Application Guide (for Sugar 5.5.0 and later versions) under the Users – Team Management section.
  • Schedulers need to be set up to run automatically.  For help on setting up schedulers, check the Installation and Administration Guide under the System – Scheduler section.
  • Inbound Email Scheduler needs to be active. Refer to the article How to activate the Inbound Email Scheduled job for more information.
  • System Email Settings are configured. For help on setting up the system email settings, check the Installation and Administration Guide under the Emails – Email Setting section

Using the Sugar theme, follow these steps for implementation:

  1. From the Home page, click on the Admin link at the top of the page
  2. Scroll down to the Email section and click on ‘Inbound Email’
  3. On the left hand side, click on ‘Monitor New Mail Account’
  4. Enter in the Name of Inbound Mail Account. For example, you can name it something like ‘Support Email to Case’
  5. Enter in the mail server address. Commonly set to  Enter in a valid username and password that has an account set up on the mail server that you are using.
  6. Select the mail server protocol you wish to use
    • For IMAP:
    • For Monitored Folders, select the folder you wish to monitor. By default this is set to INBOX.
    • For Trash Folder, select the folder you want to designate for Trash. Click OK.
    • For Sent Folder, select the folder you want to designate for Sent. Click OK.
    • Check the Use SSL checkbox if you are using SSL.  If you are not sure, then leave this blank.
    • For POP3 (supported only in versions prior to Sugar 5.5.1)
    • Check the Use SSL checkbox if you are using SSL.  If you are not sure, then leave this blank.
  7. For Sugar Enterprise and Professional, in the Email Handling Options section, assign the inbound mail account to a Team.
  8. In the Assigned to Group folder select the group folder you wish to use. If you do not have a group folder or need to create a new group folder:
    1. Click the Create button.
    2. Enter in a new Folder Name.  For example, Support Emails.
    3. Click Save.
  9. Set Possible Actions to Create Case.
  10. Choose the Distribution Method: Round Robin = Assign emails evenly between users or Least Busy = Assign emails to a user who has the shortest queue of assigned cases.
  11. For Create Case Reply Template, select an existing reply template or click Create to create a template. To create a template, take the following steps:
    • Click the Create button.
    • Enter in the Name of the Email Template.
    • Select the Team
    • Enter in the Description field.  The information in this field does not get sent to customers.
    • Enter in the Subject and Body.
    • Save
    • Select the Email Template in the ‘Create Case Reply Template’ drop down menu.
  12. For the ‘No auto-reply to this domain field’, enter in any domain name that you do not want auto replies to go to.
  13. Leave Messages on Server should be set to Yes.  Caution: If you say No, then emails will be deleted from the mail server as they are are pulled into the SugarCRM group folder.
  14. Enter in the remaining fields: From Name, From Address, Reply-To Name and Reply-To Address.
  15. Click on the Test Settings button next to the Save and Cancel buttons.  If the Test Settings process was successful, continue on to the next step.  If the Test Settings process was not successful, ensure thatstep 5 was set up correctly with the right mail account settings.  You may need to work with your IT group to troubleshoot the mail settings further.
  16. Click on the Email Tab
  17. Click on the Settings Button
  18. Select Folders.
    • You should see your new Inbound Group Mailbox in the Available Group Folders box.
    • You will not see folders such as INBOX for Group Folders.  Only a group or personal mail account will show the mail account folders such as INBOX. Group folders will simply collect the emails from their subscribed boxes and display them.
  19. Send a test email to the email address used for your group folder.
  20. The next time your scheduled job runs SugarCRM will pull emails from the configured mail account, create cases for the emails, and distribute them appropriately.

Note: If you do not see cases being created after you know for a fact that emails have come in, enable debug logging to see what might be going on.  Click here for instruction to enable debug logging.

Note: To ensure that the Account record is associated to the case at the time the case is created, the email address of the contact sending the email will need to be associated to the account record (not the contact record). Also, Contacts are not associated to cases when the case is automatically created from email. This issue is resolved in 520f.

Note: By default, Sugar does not set the case Status field to a particular value.  To tell Sugar to set the value to New, you can make the following changes at the code level:

In the function handleCreateCase() in the file modules/InboundEmail/InboundEmail.php.

Under this line

$c->name = $email->name;