pdf attachment is coming as .dat file in outlook

Hello All,

I am sending mail with attachment in WorkOrder and Sales Invoice using SMTP.

  1. in first point(WorkOrder) attachment is going properly in .pdf format

  2. but in second point(sales invoice) attachment is going as .dat

in both the cases file is saving as .pdf

I have checked the setting of Outlook- Compose messages in this format = HTML at recipient side.

from Sender side I am not able to check but it must be HTML because in Workorder case receiver is getting .pdf file.

What can be the issue.

Thanks in advance

And what functionality in which version of Dynamics NAV is this about?

To my knowledge there is no standard functionality to send mail with work order attachments in NAV. So this must be custom functionality, in which case you are better of contacting the developer. Or you are talking about something else. [emoticon:c4563cd7d5574777a71c318021cbbcc8]

Its Nav 2016 Version(9.00.46045)

Yes its custom functionality.

Is the filename attached called winmail.dat ???

No, name is coming correct. like OrderNo.dat(eg- PSI-0000111.dat, PSI-0000112.dat)

Have you tried running it with the debugger? It will show you exactly where in the code the problem occurs.

Otherwise as suggested before, if you are not the developer, then your better option is to contact your partner. Without knowing the actual code or the functionality, then it’s difficult to say what is wrong.

Thanks Erik and Palle for instant reply. I checked the code but nothing found wrong, in debugger upto last I am getting .pdf file. And sorry to not mentioned one point, if i save the attachment(.dat) as pdf it is saving as pdf file and all data is correct. so just compare both files in ‘Compare It’ tool files are identical except last line.

w - file saved by SAVEASPDF function where as other one is by saved as pdf from attachment.

So it works when you run it with the debugger?

When you run it “normally” it still gives you the wrong extensions?