I have this block of AMPScript written in my template.

    var @topupParam, @topupfilename
    set @topupParam = "\AccountActivity\022023\110697.pdf"
    set @topupfilename = "a.pdf"
    AttachFile("FTP", @topupParam, @topupfilename)
    Dear %%First Name%%
    Please find attached your latest <b>Monthly Activity Statement</b> showing the services we have provided to you.
     Please also find your tax invoice attached. 
      If you have any questions, please contact us and we will be happy to help.

As can be seen, for every contact in our data extension we attach the same file to our email For some reason, test send does not work.

"Test send" does not error during "Preview" but simply does not send any email.

Please see the image below where it says 0 emails sent.

enter image description here

enter image description here

Key points

1.I just created this FTP folder (AccountActivity) and its subfolder (022023) now. Is there a delay after a folder is created in FTP for it to be recognised by AMPscript ?

enter image description here

2.To further analyze the problem I even removed the entire AMPscript block and just ran a test email with the following template, even then when I did a test I did not get any email.

3.We already have bought the AMPscript attachfile feature and have been able to test attachments to our customers earlier.

4.This is a sendable data extension with only one record for our testing purpose

enter image description here

enter image description here

Can someone please provide their inputs or ideas ?


If I just process the Data Extension in Journey Builder, I get "Errored" which I believe to be an improvement as shown below

enter image description here

Is there any way to check what that error is ? Any logging or anything ?

  • Did you do the test send with transactional or commercial send classification? In case, you do with commercial send classification, the subscriber supposes to be existing with active status in All subscribers list
    – Duc Le
    Commented Mar 29, 2023 at 2:45
  • @DucLe I tried both "Transactional" and "Commercial"...no luck in either of them
    – daww
    Commented Mar 29, 2023 at 3:30
  • @DucLe Can you please check my latest update and let me know how to find out why a contact is errored in Journey ?
    – daww
    Commented Mar 29, 2023 at 3:54

2 Answers 2


A few things to check, which could help you.

  1. Making sure your subscribe is Active in 'All Subscribers'.
  2. Are you using a template based email, which has any ampscript blocks called or referenced to? Generally, an error indicates ampscript error.There might be some nested ampscript blocks.
  3. Can you create a blank html email, with only the necessary things and then try and send?
  4. Can you take your First Name as a ampscript value, such as ,

set @firstName = AttributeValue("First Name") and then showing as Dear %%=v(@firstName)=%%.

  • It was 2/3...a plain HTML email was working where as the one designed using the template builder (content builder) was not....Thanks
    – daww
    Commented Mar 29, 2023 at 19:55

Pretty sure that files must exist at the root of the Import folder for the AttachFile() function to work.

Official docs are here.


I'd suggest reviewing the NotSent tracking data. The Reason value will indicate the issue -- including ListDetective suppressions.

  • Wish it were as easy mate...a) we have already tested/sent/confirmed the attachments from Import/xxx folders mate b) even if i completely remove the ampscript a simple test send email is not working :(
    – daww
    Commented Mar 28, 2023 at 21:52
  • And did you clear the text version of the email? Commented Mar 28, 2023 at 22:46
  • Adam Spriggs - Can you please check my latest update...The same process causes an error when invoked via journey..I just need to know what that error is so that I can fix it..Anyway to get the debug log or anything for a record which is errored in Journey
    – daww
    Commented Mar 29, 2023 at 3:53
  • The NotSent tracking extract has a Reason field -- what does it say for the sends in question? Commented Mar 29, 2023 at 13:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .