Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: ArturoRobles

#789247
Hello,

After final approver approved case then participated user will get email with attached output document. Email is sent with attached output document but it is ATT000001.Bin file instead of pdf file. If user download this file with pdf extension then it shows correct output document but I want this file with pdf extension. See image 3.png. I used this code
Code: Select all
$docId = '96578979458995b9f6afb04041036087';
$subject = @@Title;
$caseId = @@APPLICATION;
PMFGenerateOutputDocument($docId);
$sql = "SELECT APP_DOC_UID FROM APP_DOCUMENT WHERE APP_UID='$caseId' AND DOC_UID='$docId'";
$aNewDoc = executeQuery($sql);

if (empty($aNewDoc)) {
   throw new Exception("Error: Unable to generate Output Document with ID '$docId'.");
}
else {   
   $fileId = $aNewDoc[1]['APP_DOC_UID'];
   $oDoc = new AppDocument();
   $aDocInfo = $oDoc->load($fileId);
   $ext = '.pdf';  //set to '.doc' if sending a DOC file
   $g = new G();
   $pathToFile = PATH_DOCUMENT . $g->getPathFromUID(@@APPLICATION) . PATH_SEP . 'outdocs' .
      PATH_SEP . $fileId . '_' . $aDocInfo['DOC_VERSION'] . $ext;
   $filename = $aDocInfo['APP_DOC_FILENAME'] . $ext;
   $aAttachments = array(
      $filename => $pathToFile
   );
   $c = new Cases();
   $aUsers = $c->getUsersParticipatedInCase(@@APPLICATION);
   $to = '';
   foreach ($aUsers['array'] as $userUID => $userInfo) {
      $to .= (empty($to) ? '' : ', ') . $userInfo['USR_EMAIL'];
   }

   @@msg = PMFSendMessage(@@APPLICATION, 'eworkflow@sbicaps.com', $to, '', '',
      $subject, 'Attachedmail.html', array(), $aAttachments);     
}
When I used same code with this process(Email_Attachment _Example-2) then it works fine i.e. in email document user got pdf file.

Here is my process and table schema. Downloads.zip
viewtopic.php?f=41&t=710032

Server specification
64 bit machine Windows Server 2008 R2
I have installed community edition 3.1 32 bit

I have changed in output document as well
Report Generator from HTML2PDF to TCPDF
Output Document to generate from Both to Pdf.

Thanks & Regards
Attachments
(31.49 KiB) Downloaded 562 times
3.png
3.png (37.63 KiB) Viewed 22170 times
#789268
Hello atuly7,

In the previous post, you did mention it worked in some other system, which Operating System did it work in?

I have tried running your process, in Processmaker 3.1.2 community and it works and I receive mail with .pdf extension.

I will check with Windows server 2008 and will report the result to you.

Best Regards,
Zainab
#789270
zainab wrote:Hello atuly7,

In the previous post, you did mention it worked in some other system, which Operating System did it work in?

I have tried running your process, in Processmaker 3.1.2 community and it works and I receive mail with .pdf extension.

I will check with Windows server 2008 and will report the result to you.

Best Regards,
Zainab
Thanks for reply.
I said user got email with attached file. and I think this ATT00001.bin file is attached in email because I didn't check Required authentication. See image.

Thanks & Regards
Attachments
ProcessMaker3_EmailServer_SMTPConfiguration.png
ProcessMaker3_EmailServer_SMTPConfiguration.png (30.96 KiB) Viewed 22158 times
#789288
zainab wrote:Hello atuly7,

In the previous post, you did mention it worked in some other system, which Operating System did it work in?

I have tried running your process, in Processmaker 3.1.2 community and it works and I receive mail with .pdf extension.

I will check with Windows server 2008 and will report the result to you.

Best Regards,
Zainab
Hello,
Can I get picture of your email server setting? So I can figure out what is a problem?
and same process I tested with gmail id. It works fine and users get .pdf file in email.
when email server setting changed and tested process in other pc then users got ATT00001.bin file. In other pc, I checked Required Authentication with their company's mail it gives error SMTP error: could not connect to smtp host. He used Outlook for mail.

Thanks & Regards
#789294
Hello,

Here I have attached my email server settings configured for sending emails from Gmail account.
Email Server.png
Email Server.png (25.5 KiB) Viewed 22146 times
It is possible the problem is arising because of the outlook Account, did you use Outlook as your email Server configuration to send emails? The configuration fro outlook is different, check if he is using the proper SMTP settings for outlook.

For info regarding server settings for outlook, refer to this link please https://www.outlook-apps.com/outlook-com-pop-settings/

You also need to check the mail settings of the person's account, whether it is accepting SMTP request.
#789295
zainab wrote:Hello,

Here I have attached my email server settings configured for sending emails from Gmail account.


It is possible the problem is arising because of the outlook Account, did you use Outlook as your email Server configuration to send emails? The configuration fro outlook is different, check if he is using the proper SMTP settings for outlook.

For info regarding server settings for outlook, refer to this link please https://www.outlook-apps.com/outlook-com-pop-settings/

You also need to check the mail settings of the person's account, whether it is accepting SMTP request.
I also used gmail account for configuring email server. It works fine. Even I tested it on outlook app.
But my client used their company's mail account for configuring email server and when I checked Required authentication as shown in image and clicked on test button then it shows error SMTP error: could not connect to smtp host.
Attachments
ProcessMaker3_EmailServer_SMTPConfiguration.png
ProcessMaker3_EmailServer_SMTPConfiguration.png (30.96 KiB) Viewed 22142 times
#789308
zainab wrote:Hello,

Could you please attach a screenshot of the error. This error is because PM is not able to connect to SMTP. Check your email settings once to allow SMTP connections.

Best Regards,
Zainab
I have attached screenshot of email server setting and error.
and hide area is company name.

Thanks & Regards
Attachments
2.png
2.png (40.79 KiB) Viewed 22137 times
1.png
1.png (40.19 KiB) Viewed 22137 times
#789372
amosbatto wrote:On many email servers, your Account from and your From mail need to be the same or it is treated as fraudulent and not allowed.
Can you connect to the mail server using a standard email client like Thunderbird?
Yeah. He used Microsoft Outlook.
If I set Account from and From mail same and still it will not work then what changes I have to do?
Do I need to change in setting?
Thanks & Regards
#789376
You probably have to enable SMTP connections for the account on the web site of your email provider. Another thing to do is try to connect with Thunderbird and use those settings. If that doesn't work, then call your email provider and ask.
#829511
For setting an email server, I also utilized a Gmail account. It performs admirably. I even put it to the test on the Outlook app .
However, my customer configured the email server using their company's mail account, and when I checked Required authentication as indicated in the image and clicked the test button, it returned the message SMTP problem: could not connect to SMTP host. In addition, I utilized my Gmail account to set up an email server. It performs admirably. I even put it to the test on the Outlook app.

Hello, I have the same problem. :( :(

You there, this is really good post here. Thanks f[…]

Is it possible to view HTML codes of a DynaForm an[…]

Hide / Show based on selection

Hi, I have write a function for show and hide […]