05-04-2016 11:58 AM - edited 05-04-2016 11:59 AM
Hello
I've been trying to send an email using MailTrigger examples in my standalone workflow.
But it has not worked yet. I have the following code in the web.config
<mailSettings> <smtp from="mail@gmail.com" deliveryMethod="Network"> <network host="smtp.gmail.com" enableSsl="true" port="587" userName="mail@gmail.com" password="strongpassword"/> </smtp> </mailSettings>
I have also enabled SSL
<add key="EnableSSLOnMail" value="true" />
Here is the code Workflow Settings file
<?xml version="1.0" encoding="UTF-8" ?> <WorkflowRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../XSD/Workflows/WorkflowSettings.xsd"> <WorkflowNode id="1" label="Registration" controller="Form" form="Principal"> <WorkflowNode id="10" label="Fill Form" controller="Form" form="SendInfo" emptyform="true"> <WorkflowTrigger name="MailTrigger" type="MailTrigger" method="action" condition="false"> <Param name="From" value="mail@gmail.com" /> <Param name="Recipients" value="othermail@gmail.com" /> <Param name="Subject" value="A new job has been assigned to you" /> <Param name="Body" value="A new job has been assigned to you please connect to the job management portal" /> </WorkflowTrigger> <WorkflowNode id="100" label="Sumary" controller="Form" form="SumaryForm" > </WorkflowNode> </WorkflowNode> </WorkflowNode> </WorkflowRoot>
I've already set my email account to send mail using SMTP, in fact I have another application using .Net (MailMessage) and works very well with this configuration and these email accounts.
I hope somebody can help me.
Solved! Go to Solution.
05-09-2016 01:03 AM - edited 05-09-2016 01:03 AM
Do you use identical web.config settings in your another .NET application (SSL)?
Can you see some errors in the Workflows log files?
05-09-2016 04:29 PM - edited 05-11-2016 05:01 PM
The log file does not send me any message or error for the email that I'm trying to send.
fe80::785b:928:ecb1:4f84%21 - - [09/May/2016:18:16:07 -0500] "GET /StandaloneWorkflows/Form/Navigate?workflow=ebuzzard&lang=es-MX&sessionid=8de868c0-52fa-412c-bed0-aec96df6cf6f&nodeid=1&targetNodeId=10 HTTP/1.1" 302 727 fe80::785b:928:ecb1:4f84%21 - - [09/May/2016:18:16:10 -0500] "GET /StandaloneWorkflows/Form?workflow=ebuzzard&lang=es-MX&sessionid=8de868c0-52fa-412c-bed0-aec96df6cf6f&nodeid=10 HTTP/1.1" 200 33962 fe80::785b:928:ecb1:4f84%21 - - [09/May/2016:18:16:12 -0500] "GET /StandaloneWorkflows/Content/Scripts/publicmaps/full.min.js.map HTTP/1.1" 404 132 fe80::785b:928:ecb1:4f84%21 - - [09/May/2016:18:16:27 -0500] "POST /StandaloneWorkflows/Form/Save?workflow=ebuzzard&lang=es-MX&sessionid=8de868c0-52fa-412c-bed0-aec96df6cf6f&nodeid=10 HTTP/1.1" 200 378 fe80::785b:928:ecb1:4f84%21 - - [09/May/2016:18:16:27 -0500] "GET /StandaloneWorkflows/Workflow/Navigate?workflow=ebuzzard&lang=es-MX&sessionid=8de868c0-52fa-412c-bed0-aec96df6cf6f&nodeid=10 HTTP/1.1" 302 729 fe80::785b:928:ecb1:4f84%21 - - [09/May/2016:18:16:27 -0500] "GET /StandaloneWorkflows/Form?workflow=ebuzzard&lang=es-MX&sessionid=8de868c0-52fa-412c-bed0-aec96df6cf6f&nodeid=100 HTTP/1.1" 200 16333 fe80::785b:928:ecb1:4f84%21 - - [09/May/2016:18:16:30 -0500] "GET /StandaloneWorkflows/Content/Scripts/publicmaps/full.min.js.map HTTP/1.1" 404 132
Any ideas? How I can know if mailtrigger it is really trying to send the mail?
And the web.config file of my another aplication is the same:
<system.net> <mailSettings> <smtp from="mail@gmail.com" deliveryMethod="Network"> <network defaultCredentials="false" host="smtp.gmail.com" enableSsl="true" port="587" userName="mail@gmail.com" password="strongpassword" /> </smtp> </mailSettings> </system.net>
05-10-2016 07:09 AM
Does your .NET app work on the same GMSC machine? Any chance to test it using a corporate mail server (so you can trace all the activities in the loop)? BTW any error should be logged in the Workflow.log file on the server side, if you don't get anything in there, the mail server should have accepted it...
Regards,
Stefano
05-11-2016 12:36 AM
You can also use some network sniffing tool like Fiddler to see the complet request and response data. It could reveal some more detailed error message from the mail server.
05-11-2016
11:49 AM
- last edited on
10-27-2020
09:12 AM
by
gspbsoperations
Hi. I have still the problem of sending emails.
I have to say, that my standalone workflow is on the same computer that have installed the GMSC. The standalone workflow is within the same pool site in IIS, the GMSC and the other .NET application.
I have been testing Flidder and Wireshark and no request to the mail server is recorded when I save my registration in my form of the standalone application. The Wireshark only detected requests to SMTP protocol or port 587 (gmail) when I test my .NET application with the settings that I put in my previous message.
I share an impression of Wireshark when I send the request and try to send mail in the standalone workflow. There is not activity to destination ip server email or SMTP protocol.
It seems that no request for client-side mail is not sent from the workflow.
I keep trying. Thanks
05-12-2016 12:26 AM
Sorry, it is not yet clear to me where you are using your .NET application and where GMSC and the Standalone Workflows are running. Are all of them on the same machine? In the case of Workflows the request should be sent on the server side to the smtp server, it is not on the client side.
Please also use a different IIS application pool for the Standalone Workflow application, with the same parameters used for the standard GMSC applications.
BTW if nothing is logged on the server side, there could be either an error in the workflow configuration or WFM supposes the message is sent and is not aware of any issue.
Regards,
Stefano
05-12-2016 12:29 AM
I just noticed you have a condition="false" in your trigger definition, the trigger will never be fired. From the doc:
Condition to be evaluated for the Workflow-Trigger, which defines if the trigger will be fired or not. The condition types are the same as for the Workflow-Node element (see WorkflowNode).
<condition="SQL[...sql-statement...]" />
<condition="{FORM.MARKER}" />
... works with the checkbox FormField, which delivers 0/1
HTH,
Stefano
05-13-2016 12:17 PM
Hi!
After reviewing the code, I detects that had misspelled the name of the parameter Recipients, and had not placed the 's'.
As you suggested, I remove the condition of Workflow-Node. But, now this is interesting, I changed the method to the Workflow-Node to 'after' and finally worked.
If I have the method to action the mail is not sent and do not get any messages.
In my web.config the big problem was the port. Which was 587 and I change it to 25 and it worked.
Thank you for all your help.
Regards
05-16-2016 05:38 AM
Hi,
if the trigger is of type "action" you have to call the IG.trigger method in a dedicated FormAction in order to get the action fired.
Triggers of type "after" are fired when you post the current form content.
Regards,
Stefano