Mail Configuration

*** Settings ***

Resource  plone/app/robotframework/server.robot
Resource  plone/app/robotframework/keywords.robot
Resource  Selenium2Screenshots/keywords.robot

Library  OperatingSystem

Suite Setup  Run keywords  Suite Setup  Test Setup
Suite Teardown  Run keywords  Test teardown  Suite Teardown

*** Variables ***

${FIXTURE}  plone.app.robotframework.PLONE_ROBOT_TESTING
@{DIMENSIONS}  1024  768
@{APPLY_PROFILES}  plone.app.contenttypes:plone-content


*** Keywords ***

Suite Setup
    Run keyword if  not sys.argv[0].startswith('bin/robot')
    ...             Setup Plone site  ${FIXTURE}
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Open test browser
    Run keyword and ignore error  Set window size  @{DIMENSIONS}

Test Setup
    Import library  Remote  ${PLONE_URL}/RobotRemote

    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Remote ZODB SetUp  ${FIXTURE}

    ${language} =  Get environment variable  LANGUAGE  'en'
    Set default language  ${language}

    Enable autologin as  Manager
    ${user_id} =  Translate  user_id
    ...  default=jane-doe
    ${user_fullname} =  Translate  user_fullname
    ...  default=Jane Doe
    Create user  ${user_id}  Member  fullname=${user_fullname}
    Set autologin username  ${user_id}

Test Teardown
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Remote ZODB TearDown  ${FIXTURE}

Suite Teardown
    Run keyword if  not sys.argv[0].startswith('bin/robot')
    ...             Teardown Plone Site
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Close all browsers
Mail setup configuration

Completing this configuration allows your Plone site to send email. If the mail settings are not configured properly, you will not be able to receive form submissions via email from your site, and users can’t be contacted for an email reset link.

Using localhost for email

One common way to configure mail for your Plone site is to use a mail server on the same machine that is hosting Plone. To do this, you’ll first need to configure a mail server, like Postfix.

SMTP Server: localhost
SMTP Port: 25
ESMTP Username: Leave this blank
ESMTP Password: Leave this blank
Site ‘From’ Name: [This will appear as the “From” address name]
Site ‘From’ Address: [emailaddress]@[yourdomain]

Using an external host

The following settings are an example of how you can configure your site to use your Gmail address. You can also use any external mail server, such as your business or institution email (you can get your SMTP settings from your in-house IT department).

SMTP Server: smtp.gmail.com
SMTP Port: 587
ESMTP Username: [username]@gmail.com
ESMTP Password: [Your Gmail Password]
Site ‘From’ Name: [This will appear as the “From” address name]
Site ‘From’ Address: [Your Gmail Address]

Testing the Configuration

You can test the configuration by clicking the “Save and send test e-mail” button at the bottom of the form. You should receive an email from the email address you specified with the subject “Test email from Plone.”