Dreamfactory SMTP emails never sending

Hi,

I’ve had a lot of success with my first week of using Dreamfactory, but have now stumbled upon an issue that I cannot seem to overcome.

I am trying to get SMTP mail working.

I upgraded to the latest DSP (1.8.2) as I read there were potential issues with the previous version.

I have setup the SMTP options using the GMAIL SSL SMTP settings (and tried TLS port/security)
Host: smtp.gmail.com
Port: 465
Security: SSL
Username: my_gmail_account@gmail.com
Password: my_gmail_password

When I use swagger to test, I enter the data as follows:
{“to”:
[ {
“name”: “Andy”,
“email”: "mytest@myemail.com"
}
],
“subject”: “The Subject”,
“from_name”: “Me”,
“from_email”: "mygmailaccount@gmail.com"
}

the response body I get is [code 200]:
{
“count”: 1
}

the response headers I get are:
{
“Date”: “Tue, 02 Dec 2014 14:34:24 GMT”,
“X-Powered-By”: “PHP/5.4.32”,
“X-Dreamfactory-Origin-Whitelisted”: “1”,
“P3p”: “CP=“IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT””,
“Access-Control-Max-Age”: “900”,
“Connection”: “Keep-Alive”,
“Content-Length”: “11”,
“Keep-Alive”: “timeout=5, max=99”,
“Pragma”: “no-cache”,
“X-Dreamfactory-Source”: “http://myserverdetails:88”,
“Server”: “Apache”,
“X-Frame-Options”: “SAMEORIGIN”,
“Access-Control-Allow-Methods”: “GET, POST, PUT, DELETE, PATCH, MERGE, COPY, OPTIONS”,
“Content-Type”: “application/json; charset=utf-8”,
“Access-Control-Allow-Origin”: “http://myserverdetails”,
“Cache-Control”: “no-store, no-cache, must-revalidate, post-check=0, pre-check=0”,
“Access-Control-Allow-Credentials”: “true”,
“Access-Control-Allow-Headers”: “Content-Type, X-Requested-With, X-DreamFactory-Application-Name, X-Application-Name, X-DreamFactory-Session-Token”,
“Expires”: “Thu, 19 Nov 1981 08:52:00 GMT”
}

But, I never ever get an email sent, can you help please?

regards

Andy

Hi Andy, could you post the mail-related settings of your PHP INI?

Hi Jeff,

I’ve had to put this part of the project on hold for a couple of days, as we now have the Dreamfactory server fully up and running in our data centre. I’m configuring it for a demo to senior leadership and when thats done, I will return to the email aspects as this will be crucial for the next step - i.e. user self registration to use the app.

Many thanks for your support so far.

Sounds good. The "count": 1 and response of 200 should, of course, mean the message was sent. Is it possible the message ended up in spam, or more likely, your ISP is blocking outbound mail?

So Jeff,

I’ve configured the DSP to use our own internal SMTP server and have telnet’d to the server to prove SMTP works on port 25, I get the 200 response as before with a count of 1: but no mail.

I configured the PHP.ini to log mail events to the sys log, and here’s what I got (I had to put spaces in the commented http settings to allow this to post) (my PHP.ini mail settings are below as well):

The description for Event ID 2 from source PHP-5.4.32 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

php[3024]
mail() on [C:\Bitnami\dreamfactory-1.8.2-0\apps\dreamfactory\htdocs\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\SimpleMailInvoker.php:36]: To: Andy me@myemail.com – Headers: Message-ID: 44d5ea05dd8956a4cce69c674d049a29@localhost Date: Fri, 05 Dec 2014 05:08:05 -0800 From: My Name andrew.me@myemail.com Reply-To: andrew.me@myemail.com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=swift_v4_1417784885_7853c3b5bc48927dfe9453f5c75019f0="

Here’s my PHP.ini:
[mail function]
; For Win32 only.
; h ttp://php.net/smtp
SMTP = 10.204.210.51
; h ttp://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; h ttp://php.net/sendmail-from
sendmail_from = andrew.me@myemail.com

; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
; h ttp://php.net/sendmail-path
sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
mail.log = syslog

One thing I have found while searching for more information is this post on GitHub (I am using windows server and it says additional requirements are needed for Windows installs):

Bitnami Installs

For DSP instances that used any of the Bitnami packages for installation, most of the required additional libraries, drivers, and/or packages are already installed by default. See the table below for whether the service is ready to use with no additional requirements. For ‘NO’ values, see the particular service type section below for how to install the additional requirements.

Environment / Service Windows Linux OS X
Server-Side Scripting YES YES YES
NoSQL DB - MongoDB YES YES YES
SQL DB - MySQL YES YES YES
SQL DB - MS SQLSRV NO YES YES
SQL DB - PostgreSQL YES YES YES
SQL DB - Oracle NO NO NO
SQL DB - IBM DB2 NO NO NOT SUPPORTED
Email Service NO YES YES