PDF attachment not working with cfmailparam on new server

We moved from Windows 2012R2, Lucee to Windows 2016, Lucee
Attaching a PDF with cfmailparam works on server 1 but it won’t attach on server 2, must be to do with HTML/CSS/CF code etc in the PDF as we have created a new test PDF with just plain text in it and it works correctly.
Any suggestions would be great thanks.

what do you mean won’t attach? does it fail silently or is it throwing an error?

no errors, I verify that the file exists. so I just removed all html/css/cf code and only leave cfdocument with ‘< h2 >testing< /h2 >’ and it works, very odd, actully find an error in mail.log
“ERROR”,“Thread-124698”,“09/11/2020”,“15:39:47”,"","mail;Exception reading response;lucee.runtime.exp.NativeException: Exception reading response
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2202)
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2087)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1889)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1120)
at lucee.runtime.net.smtp.SMTPSender.run(SMTPSender.java:64)
Caused by: javax.mail.MessagingException: Exception reading response;
nested exception is:
java.net.SocketException: Connection reset
… 5 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:124)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:89)
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2182)
… 4 more

That looks like a network error rather than anything else to do with the PDF?

Can you send a normal mail from that server?

sorry do you mean a normal mail without attachment ? yes I can and like I said if I remove all the code and leave only a basic html tag in there then it works with attachment also

just an update that the problem lies with an img within cfdocument, the image exists and shown correctly when the PDF is open in browser but it will not attach to cfmail with the img present only if I remove it.
Any ideas what might be causing this ?

don’t know, can you create a simple test case?