Page 1 of 1

Email attached file is ATT00001.bin instead of pdf

Posted: Mon Feb 20, 2017 1:35 pm
by atuly7
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

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Tue Feb 21, 2017 6:38 am
by zainab
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

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Tue Feb 21, 2017 7:00 am
by atuly7
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

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Wed Feb 22, 2017 1:47 am
by atuly7
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

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Wed Feb 22, 2017 6:09 am
by zainab
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 36689 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.

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Wed Feb 22, 2017 6:25 am
by atuly7
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.

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Wed Feb 22, 2017 8:13 am
by zainab
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

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Wed Feb 22, 2017 8:40 am
by atuly7
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

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Wed Feb 22, 2017 1:17 pm
by amosbatto
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?

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Fri Feb 24, 2017 8:05 am
by atuly7
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

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Fri Feb 24, 2017 10:50 am
by amosbatto
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.

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Mon Jun 26, 2017 6:40 am
by Moltback
In such cases, this method is best suited. Remove the standard email software from Microsoft with the help of Windows Power Shell. After that you need to disable all email services and reinstall it
https://yumdownload.com/thunderbird . After these procedures, you will no longer remember this.

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Fri Sep 17, 2021 2:03 am
by aricjoshua
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.

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Mon Apr 04, 2022 1:45 pm
by hoadao3493
Thank you for sharing this great article. https://km888b.net hopes you will have many more articles for everyone to read.

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Thu Aug 04, 2022 6:07 am
by petergroft
Email attached file is ATT00001. bin instead of pdf. You probably have to enable SMTP connections for the account on the website of your email provider. Another thing to do is try to connect with Thunderbird and use those settings.

This May Help,
Peter

Re: Email attached file is ATT00001.bin instead of pdf

Posted: Mon Apr 24, 2023 8:12 am
by salmawisoky
Another great article filled with GREAT information Thank you! LOVE the "extra fun" you shared.