Go Back

corrupt files when sending PDF attachments via SMTPmail

I am using SMTPMAIL to send PDF files as attachments, running synergy 10.3.3b under window 10

I am trying to send a single PDF file attachment with each email

I can send message without attachments fine.

My PDF file which I create (via synPDF) is fine.  It can be opened, emaioled and printed within Adobe, but when I email it as an attachment via SMTPmail it is corrupted at the far end and the recipient can't open it.

Has anyone used SMTPmail to send PDF attachments successfully ?

Any help would be greatly appreciated 

10 Answers
0   | Posted by Gordon Ireland to Other on 6/9/2017, 3:45 PM
Phillip Bratt
One common issue for this is the file is being sent in ASCII mode but PDF is a binary file. So you will need to treat it as such in your code. Hopefully that helps. 

6/9/2017, 5:18 PM   0  
Gordon Ireland
Thanks Phillip.  I found where it changes the way it sends JPGs and modified the code to include PDFs.  But it uses a DLL called B64.DLL which I don't have.  I tried downloading one but it then didn't find the call it used in the DLL.

Anyone know where I can get a B64.dll which will work with SMTPMail ?

Gordon
 

6/11/2017, 5:04 PM   0  
Gordon Ireland
I used a freeware, command line product called BLAT instead, which has a -base64 switch which avoids corruption.

So I will just construct and spawn a command line to use BLAT to send any PDFs I have.

I am happy to pass on details to anyone who is interested.

I want to thank Lloyd Sayman for introducing me top BLAT and helping me get it going

It is a very simple product to use

  

6/13/2017, 9:30 AM   0  
Bill Ferris
Gordon --

Our experience with SMPTMAIL and PDF attachments was that it only worked around 95% of the time   --- which was just good enough to be fantastically annoying.

Like you, we chose to change to a freeware executable.  Our choice was MAILSEND.EXE.

The main thing with any email product is what authentication and encryption protocols it supports.  

MAILSEND.EXE supports :
    Authentication Methods:  LOGIN, PLAIN, CRAM
    Encryption Methods: SSL, TLS, none

It specifically does not support the NTLM authentication method used by Microsoft Exchange servers.
 

6/15/2017, 7:15 PM   0  
Gordon Ireland
It would be good if Synergex could help with this sort of thing.  Maybe provide a supported language feature ????

Its something everyone faces and emailing a PDF is something which should be a no-brainer.

 

6/15/2017, 8:55 PM   0  
Phillip Bratt
If you feel like that would be a good feature to have then please make a post on the Ideas forum. We are always looking for ways to improve the product. 

6/15/2017, 9:13 PM   0  
Chris Aiken
We had the same issue with SMTPMAIL and ended up with BLAT. Very reliable, easy to use, debug and logging options and you can always run the command from a prompt to see what it's doing. We send out loads of PDF documents every week.

6/16/2017, 11:08 AM   0  
Tony Rivers
Can anyone supply the links for sendmail and Blat?
I need to write an emailing program for a standalone Windows 7 PC.SMTP is no longer part of the OS and am wondering if I can use Sendmail or Blat. 

6/22/2017, 8:10 PM   0  
Gordon Ireland
download from http://www.blat.net/

navigate
to the folder you down load to and type BLAT -h > blat.txt.

You now have a manual

Here is the command which worked for me, to send a PDF without corruption :

blat c:\trs_livedata\pdf\TRSPurchaseOrder_473658.pdf -base64 -server xyz.xaracloud.net -f notifications@trs.co.uk -subject "test email" -to g_ireland@btinternet.com
 

6/22/2017, 8:19 PM   0  
Bill Ferris
OK -- Well it turns out the product we use is MAILSEND.EXE   (not SENDMAIL.EXE !!!!).

Sorry for any confusion. 

The link for the download is:      https://github.com/muquit/mailsend

6/22/2017, 8:23 PM   0  
Please log in to comment or answer this question.