Forum

Thread tagged as: Problem, Error, Configuration

SMTP Connection() Error for Mailtrap / MAMP

Hello,

I'm trying to setup the forms app email function. I've successfully got the form app working, all the details are being recorded correctly on the forms app interface.

I've set up a mailtrap account now and I've altered the config.php file to suit the correct username / password for the mailtrap account.

However, when I try to send a test email from settings > email I get an error

SMTP connect() failed.

Can anyone advise where I'm going wrong?


Diagnostics report PERCH INFORMATION Perch: 2.8.6 Production mode: Production (100) Installed apps: content (2.8.6), assets (2.8.6), categories (2.8.6), perch_forms (1.8.3), perch_gallery (2.8.6) DB driver: PDO DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_gallery_albums, perch2_gallery_image_versions, perch2_gallery_images, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users Users: 1 App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_gallery', ); Editor plug-ins: ace, ckeditor, markitup H1: 421aa90e079fa326b6494f812ad13e79 L1: d8f430a8d29aa5ddec30e44617390bce headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb update_2.8.5: done latest_version: 2.8 on_sale_version: 2.8.6 update_2.8.6: done headerScheme: light dashboard: 0 hide_pwd_reset: 0 content_hideNonEditableRegions: 0 content_frontend_edit: 0 logoPath: /perch/resources/ap2project-logo.png perch_gallery_update: 2.8.5 PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: root PERCH_DB_SERVER: localhost:8889 PERCH_DB_DATABASE: woof-dubai PERCH_DB_PREFIX: perch2_ PERCH_TZ: Asia/Dubai PERCH_EMAIL_FROM: marc.jeffrey@ap2project.com PERCH_EMAIL_FROM_NAME: Tania Richards PERCH_LOGINPATH: /perch PERCH_PATH: /Users/marc-jeffrey/Projects/WOOF/root/perch PERCH_CORE: /Users/marc-jeffrey/Projects/WOOF/root/perch/core PERCH_RESFILEPATH: /Users/marc-jeffrey/Projects/WOOF/root/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_EMAIL_METHOD: smtp PERCH_EMAIL_HOST: mailtrap_host PERCH_EMAIL_SECURE: tls PERCH_EMAIL_AUTH: 1 PERCH_EMAIL_PORT: 2525 PERCH_EMAIL_USERNAME: 3519600f7b76c9351 PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_DEBUG: PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /Users/marc-jeffrey/Projects/WOOF/root/perch/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: HOSTING SETTINGS PHP: 5.6.7 Zend: 2.6.0 OS: Darwin SAPI: apache2handler Safe mode: not detected MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $ MySQL server: 5.5.42 Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, mysqli, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysql, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, gettext, mcrypt, yaz, pgsql, pdo_pgsql GD: Yes ImageMagick: No PHP max upload size: 32M PHP max form post size: 32M PHP memory limit: 128M Total max uploadable file size: 32M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: Yes HTTP_HOST: localhost:8888 HTTP_CONNECTION: keep-alive HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 HTTP_REFERER: https://localhost:8888/perch/core/settings/diagnostics/ HTTP_ACCEPT_ENCODING: gzip, deflate, sdch HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8 HTTP_COOKIE: PHPSESSID=b27c8e336c5fb266623ab51c75097287; cmsa=1; _ga=GA1.1.1922225008.1431155935 PATH: /usr/bin:/bin:/usr/sbin:/sbin SERVER_SOFTWARE: Apache SERVER_NAME: localhost SERVER_ADDR: ::1 SERVER_PORT: 8888 REMOTE_ADDR: ::1 DOCUMENT_ROOT: /Users/marc-jeffrey/Projects/WOOF/root SERVER_ADMIN: you@example.com SCRIPT_FILENAME: /Users/marc-jeffrey/Projects/WOOF/root/perch/core/settings/diagnostics/index.php REMOTE_PORT: 55509 GATEWAY_INTERFACE: CGI/1.1 SERVER_PROTOCOL: HTTP/1.1 REQUEST_METHOD: GET QUERY_STRING: extended REQUEST_URI: /perch/core/settings/diagnostics/?extended SCRIPT_NAME: /perch/core/settings/diagnostics/index.php PHP_SELF: /perch/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1432107775.92 REQUEST_TIME: 1432107775 argc: 1
Marc Jeffrey

Marc Jeffrey 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It sounds like the SMTP settings are wrong.

This is incorrect:

PERCH_EMAIL_HOST: mailtrap_host

I would expect your config file to include something like

define('PERCH_EMAIL_HOST', 'mailtrap.io');

Thanks Drew!

Worked perfect!

Next issue... I tried the same setting on the live site and I'm getting the same error?


Diagnostics report PERCH INFORMATION Perch: 2.8.5 Production mode: Production (100) Installed apps: content (2.8.5), assets (2.8.5), categories (2.8.5), perch_forms (1.8.3), perch_gallery (2.8.6) DB driver: PDO DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_gallery_albums, perch2_gallery_image_versions, perch2_gallery_images, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users Users: 2 App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_gallery', ); Editor plug-ins: ckeditor, markitup, ace H1: 4b4649912f176f8b3185590fcd2e8366 L1: d8f430a8d29aa5ddec30e44617390bce headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb update_2.8.5: done latest_version: 2.8 on_sale_version: 2.8.6 update_2.8.6: done headerScheme: light dashboard: 0 hide_pwd_reset: 0 content_hideNonEditableRegions: 0 content_frontend_edit: 0 logoPath: /perch/resources/ap2project-logo.png perch_gallery_update: 2.8.5 PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: woof-admin PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: woof-dubai PERCH_DB_PREFIX: perch2_ PERCH_TZ: Asia/Dubai PERCH_EMAIL_FROM: marc.jeffrey@ap2project.com PERCH_EMAIL_FROM_NAME: Tania Richards PERCH_LOGINPATH: /perch PERCH_PATH: /home/ap2hosting/public_html/woofdubai.ae/perch PERCH_CORE: /home/ap2hosting/public_html/woofdubai.ae/perch/core PERCH_RESFILEPATH: /home/ap2hosting/public_html/woofdubai.ae/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_EMAIL_METHOD: smtp PERCH_EMAIL_HOST: mailtrap.io PERCH_EMAIL_SECURE: tls PERCH_EMAIL_AUTH: 1 PERCH_EMAIL_PORT: 2525 PERCH_EMAIL_USERNAME: 3519600f7b76c9351 PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_DEBUG: PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /home/ap2hosting/public_html/woofdubai.ae/perch/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: HOSTING SETTINGS PHP: 5.4.37 Zend: 2.4.0 OS: Linux SAPI: cgi-fcgi Safe mode: not detected MySQL client: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $ MySQL server: 5.5.32-cll-lve Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, json, mbstring, mcrypt, standard, mysql, mysqli, mysqlnd, apc, posix, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, zip, cgi-fcgi, PDO, pdo_sqlite, Phar, imagick, pdo_mysql, ionCube Loader, Zend Guard Loader GD: Yes ImageMagick: Yes PHP max upload size: 32M PHP max form post size: 48M PHP memory limit: 64M Total max uploadable file size: 32M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: No PATH: /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin PWD: /usr/local/cpanel/cgi-sys PHP_FCGI_MAX_REQUESTS: 5000 SCRIPT_NAME: /perch/core/settings/diagnostics/index.php REQUEST_URI: /perch/core/settings/diagnostics/?extended QUERY_STRING: extended REQUEST_METHOD: GET SERVER_PROTOCOL: HTTP/1.1 GATEWAY_INTERFACE: CGI/1.1 REMOTE_PORT: 61221 SCRIPT_FILENAME: /home/ap2hosting/public_html/woofdubai.ae/perch/core/settings/diagnostics/index.php SERVER_ADMIN: webmaster@woofdubai.ap2hosting.com CONTEXT_DOCUMENT_ROOT: /home/ap2hosting/public_html/woofdubai.ae REQUEST_SCHEME: http DOCUMENT_ROOT: /home/ap2hosting/public_html/woofdubai.ae REMOTE_ADDR: 5.31.157.141 SERVER_PORT: 80 SERVER_ADDR: 192.186.195.199 SERVER_NAME: woofdubai.ae SERVER_SOFTWARE: Apache/2.4.12 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_fcgid/2.3.10-dev LD_LIBRARY_PATH: /usr/local/apache/lib HTTP_COOKIE: PHPSESSID=7142479d3ce3a26937619147c850e752; cmsa=1; _ga=GA1.2.349508389.1431174887 HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8 HTTP_ACCEPT_ENCODING: gzip, deflate, sdch HTTP_REFERER: https://woofdubai.ae/perch/core/settings/diagnostics/ HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 HTTP_CONNECTION: close HTTP_HOST: woofdubai.ae UNIQUE_ID: VVxWG7ioyCwAAElvRlIAAADK FCGI_ROLE: RESPONDER PHP_SELF: /perch/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1432114715.52 REQUEST_TIME: 1432114715 argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is your host blocking that port?

Thanks Drew,

Just kept on trying random configuration settings and 1 eventually worked.

As you said it was a different port and also SSL instead.

Thanks again for your support!