Hii,
You will need to set up the Model Reflection module and the Encryption module. Add the Model Reflection administration page to your navigation; the page is called “MxObjects_Overview.” Then expand the encryption module and set a value for the constant called “EncryptionKey;” this value needs to be a sixteen-character string.
(Helpful Hint: Press CTRL + G to search for pages, microflows, or resources)
02 (1000×563) (squarespace-cdn.com)
Now you can run your project. You can choose to run locally or to deploy to your sandbox. Once the project has compiled, click “View” to have it open in a browser.
When you open your project, the screen you land on is your home page. The first thing you should do is navigate to your Model Reflection administration page and press the “Click to Refresh” button, (make sure to check the EmailCustom module).
Next, navigate to the email administration page and perform the first-time setup. I like to use a Gmail address to send emails, but you can use any SMTP settings.
The settings for a Gmail account are:
· Gmail SMTP server address: smtp.gmail.com
· Gmail SMTP username: Your full Gmail address (e.g., yourusername@gmail.com)
· Gmail SMTP password: Your Gmail password
· Gmail SMTP port (TLS): 587
· Gmail SMTP port (SSL): 465
Once you have entered your credentials, you can click the “next” button and proceed with sending a test email.
Most of the time Gmail will block your Mendix app until you turn on the “Allow Less Secure Apps” setting. If you run into this issue, the error that will be returned will be that your password is incorrect. To allow less secure apps check out this Google article.
If your email went through, congrats! You have just setup email functionality in your Mendix app. Now to take this a step further, let’s setup a template with a token, and then send an email from a microflow.
The first thing you should do is open the “My First Template” example. Then scroll to the bottom and find the ‘tokens” section. Here is where you can link an entity and its attributes from your database to your email templates. For this example, we will use the “EmailInfo” table in the EmailCustom module.
The select object would be “email info” and then you can press “new” to create a token for each attribute in your selected object. In our case, there will only be one attribute in the email info table that we can create a token.
The “token” field would be the name of your token, the “type” would be the attribute, and the “attribute” field is where you would select “info.” When that is created you can add your token to the body of the email. To call your token you need curly braces and a percent sign around the name of your token. In this example, our token would be “{%TestToken%}". Now that your template is created, you can use it in a microflow to send an email. In the EmailCustom module that I created, there is a microflow called “Example_SendEmail.” Right-click this microflow to include it in your project, and then put an email address in the email address variable. Or create your own microflow from this example.
Once that is done you can add this button to a page anywhere in your app to conduct the test.
Next run your application and then press the button that you just added. There will be a popup message if your email was successful, and you should receive an email in your inbox.
If you received the email then congrats! You just sent your first test email!
Thank You!!!
Hi Hartley Robinson ,
you can see this documentation for more information
Thank you !!
I found the issue that was causing my application’s Email Connector setup not to work.
It was a JAR file issue.
The file javax.mail-1.6.0.jar that existed in the userlib was causing problems.
Steps followed:
That said the JAR file causing this for you may not be the javax.mail-1.6.0.jar file as well. In that case I recommend that a comparison of a new app where the Email Connector module has been imported against the existing application.
Who’s your email provider? If it’s a Gmail account you need to generate an app password for Mendix to use. Let me know, I spent a good month battling with the Email Connector when we migrated to it.
Refer documentation
Before you use the Email connector in your app, do the following: