Jump to content
Server Maintenance This Week. ×

EmailAttachFile coorupt attachment No 2..(n) in loop

This topic is 2774 days old. Please don't post here. Open a new topic instead.

Recommended Posts

FM 14 running on MAC OS X 10.11.6

EmailAttachFile command seams to fail

When trying to send attachment trough a path to a folder I've get error message.

I Get the path  from the script command "Get Folder" (Hope i translate it from Swedish correctly) and it's look like this: "/HD_8 Samsung_500Gb/Users/GAG5D/Desktop/Bilagor ArsmoteStyrelseprotokoll/" who is added to EmailAttachFile command trough a value of "Set Variable" - named "$$epostBilaga", who is accepted without any error.

When running the "EmailSend" a POP UP error message comes up, and the value from "EmailLastError" is: "/Volumes/HD_8 Samsung_500Gb/Users/GAG5D/Desktop/Bilagor ArsmoteStyrelseprotokoll"

"Volumes" is the difference between the "Path:s", who is added to error message path.


1. That pat to folder will make a .zip of it autamtically = It seams to fail.
2. That "Volumes" is added to "path" from FM, and without any demands on actions - WHY is the path coursing a error?

Please advice - IS THIS A BUG?

IS THERE ANY "Work around", when the needs is to attach 1-10 attachment depending on the e-message, when running a Bulk operation in html to many different e-mail receivers?


Manually setting EmailAttachFile

1. IF I manually set the path to the FOLDER = "EmailSend" IS FAIL!  And no zip file is created such as the manual says!

2. IF I manually set the path to one of the FILES (inside the Folder above)  = "EmailSend" Running without failures

Edited by MrG
Link to comment
Share on other sites

When create a loop for related attachment DB from container-field, only the first attachment is correct, the No 2  and 3 is corrupt!

Here is my code for 3 related attachment to the Message Database message->Attachment (related to 3 posts and the container field in each post trough relation >>  DB-message_ID  = Attachment_ID_message)


    $attachment EmailAttachFile (attachment::postattach)
         Go To Record/Request [ Next ; Exit After Last ]
 End Loop


THIS MAKES THE No 2 and No 3 attachment corrupt - I think this is a bug. The 3 attachment is all included in the mail message, but only No 1 is correct, the rest is corrupt.

This solution is when I try to find a "workAround" to my issue yesterday:  


Edited by Lee Smith
merged the two topics
Link to comment
Share on other sites

SPECIAL NOTE - About the corrupt No 2 attachment - Issue.

When comparing the attached file No 2 to the original by using DiffMerge program I've got a error message - see picture.

When comparing the two files open by BBedit - there is no difference "inside" the files.

Please let me know if I should send the corrupt pdf-file to anyone by mail?  ;)


Skärmavbild 2016-08-26 kl. 15.27.40.png

Link to comment
Share on other sites

  • 3 weeks later...

To Who it may concern !...

About the two bugs.

Is it possible to expect a solution in the near future?

I like 360Work solution and will by the program if a solution of these two bug is in near future ;)

Link to comment
Share on other sites

Hi MrG,

We have addressed the zipping issue. You can download the new build here .  As for the corruption, I am not able to reproduce this issue. I set up a solution that has three records that only has a container field on the layout. I then set up a script that creates and email, loops through the records and attaches a different pdf and then sends the email. When the email is delivered, all of the attachments open without issue. When you do this process, are you attaching the same files every time? Can you open these files before you attach them to the email? My concern is that these files are already corrupt before they are being attached to the email.


Link to comment
Share on other sites


Thanks for the quick reply, I will give you answer on the question. First, the original attached files is NOT corrupt.
I have tried to send the message trough two different smtp servers, One is Google (port 465 and ssl=1) and the first is space2u.com (port 2525, no ssl).

I also made a check by phone "on line" with support on space2u.com directly on the smtp mail logs, no error detected.

I have attached example on received file (after sending mail to my selves). The original and the received file.

The files is in a container field, related to the email message in separated posts. The related attachment loop fetching the container field is repeating until "last post", in my test is 3 related attachments

Translation Swedish -> english:
$$antalBilagor  = Number of attached files

Bilaga_Epost_SMTP::Bilaga = where ”Bilaga” is a container-field - with the attachment file, related  to the singel ”Email message” post

Pers_SMTP::e_postadress = Register with recepients holding the e-mail adress, name etc

The attachment loop (EmailAttachFile) turns until ”last post” is reached. In my case 3 files

	Utför script [ “Ange E-postuppgifter Gmail” ]
		If [ $$antalBilagor > 0 ]
		Gå till layout [ “Bil_Epost_SMTP” (Bilaga_Epost_SMTP) ]
		Gå till post/sökpost/sida[ Första ]
			Ange variabel [ $$bilagor; Värde:EmailAttachFile(Bilaga_Epost_SMTP::Bilaga) ]
			Gå till post/sökpost/sida
			[ Nästa; Avbryt efter sista ]
			End Loop
		Gå till layout [ “Pers_SMTP” (Pers_SMTP) ]
		End If
	Ange variabel [ $setRecipient; Värde:EmailRecipients( Pers_SMTP::e_postadress ) ]
	Ange variabel [ $msgSend; Värde:EmailSend ]
	Ange variabel [ $$Error; Värde:EmailLastError ]
	Ange variabel [ $avsluta; Värde:EmailDisconnect ]
	Gå till post/sökpost/sida
	[ Nästa; Avbryt efter sista ]
End Loop

The problem is that only the first attachment is correct. The number 2...(n) will be corrupt somewhere in the file-head. Inside is exactly the same, if open and compare with BBedit

Diff merge gives "error-message" as posted before.

Hope this can clear things out




Link to comment
Share on other sites


I am still not able to reproduce the corruption. I can attach your pdf 3 times to an email and all three attachments come through and open without issue. However, after going back through the this thread it looks like this was a workaround to the zip issue. Has that new build I linked in my last post resolved that?

Link to comment
Share on other sites


Thank for the update 2.175, in this moment i had time to test the zip-function attachment of folder - And it Works successfully ;)

However, the EmailAttachFile in loop with more then one file attached, still makes no 2...(n) corrupt somewhere in the file-head. Have you take a look on the "corrupt.pdf" file above?

I will make a new extra Filemaker-file, just holding enough for testing EmailAttachFile in different ways to be shore I haven't missed something in the script. (ie have 2 container fields in e-message database, instead of the related attachment data base, as in my test).

Later, I will also test use "Troi File Plug-In" to get the Files path directly, and see if any changes could come up...

@ryan360Works - Did you send the attachment files through a loop in a related DB, or directly from 2 or more container included in the message DB, when you did try?

Thanks - for the solution and fix on the first problem. Hope we will find out what's wrong on the second 2..(n)-problem ;)


Link to comment
Share on other sites


Can you submit your log files to our support system? Please replicate the corruption issue and send an email referencing this thread to [email protected] and attach your logs. See this page for log locations. Make sure to send the logs before any restarts of FileMaker as this will overwrite the logs. 

Link to comment
Share on other sites

In this moment I have done tests on an minimal database, in purpose to recreate and find the  2..(n) problem. I have found the reason!

I have a script - adding the attachment where the script step is "add file"! IF YOU SET "compress if possible" the attachment will be corrupt - HERE IS THE REASON !

I hope this analysis will help, and to find a solution - It would be wonderful if this problem could be fixed. Phuuu ;)




Link to comment
Share on other sites

This topic is 2774 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.