FaxPress - Using Telnet with PDF Attachments, Email to Fax - TechRepublic
General discussion
September 14, 2009 at 09:48 AM
logick1

FaxPress – Using Telnet with PDF Attachments, Email to Fax

by logick1 . Updated 16 years, 10 months ago

Many people have asked about sending Email-to-Fax programmatically using FaxPress. We use
FaxPress 5000. You need to install the FaxPress SMTP Gateway to convert between SMTP and the proprietary Castelle Program Interface (CPI). You can then address the SMTP Gateway like any other SMTP server. The transcript below is a working Telnet example. If you can get your application to submit the data in this format, you’re good to go. Note that the
Content-Type:application/octet-stream, line breaks before & after boundaries, and From: header are all necessary. Content-Type:application/pdf does NOT work (PDFs are Faxed using Content-Type:application/octet-stream). The PDF was converted to Base 64 using base64.exe
base64 -e myfile.pdf myfile2.pdf
The procedure is: Open myfile2.pdf (the Base 64 output of the operation above) in Notepad, Select All, Copy to copy/paste buffer, paste into the SMTP dialogue in the DOS window (see below) using Edit -> Paste menu of DOS Window. base64 of the 338 KB PDF file is about 462 KB. In this example, 91234567@10.10.10.100 is the target Fax number (prefixed with 9 to get an outside line), followed by the IP address of the FaxpPress 5000. It’s set up in Faxmain to use our SMTP server for delivering response emails etc. 10.20.20.200 is the address of the FaxPress SMTP Gateway.

C:\>telnet 10.20.20.200 25
220 mycomputer FaxPress email Gateway is ready at Mon, 14 Sep 2009 11:20:12 Eastern Daylight Time
helo mycompany.com
250 mycomputer Hello mycompany.com
mail from:
250 Sender OK
rcpt to:<91234567@10.10.10.100>
250 <91234567@10.10.10.100> Recipient OK
data
354 Ready to receive data

To: me@mycompany.com
From: me@mycompany.com
Subject: Testing FaxPress – Attachments
MIME-Version: 1.0
Content-Type:multipart/mixed;boundary=”KkK170891tpbkKk__FV_KKKkkkjjwq”
–KkK170891tpbkKk__FV_KKKkkkjjwq
Content-Type: text/plain; charset=US-ASCII
testing
–KkK170891tpbkKk__FV_KKKkkkjjwq
Content-Type:application/octet-stream;name=”myfile.pdf”
Content-Transfer-Encoding:base64
Content-Disposition:attachment;filename=”myfile.pdf”

JVBERi0xLjUNJeLjz9MNCjEgMCBvYmoNPDwvTWV0YWRhdGEgNTMgMCBSL1BhZ2VzIDIgMCBSL09D
UHJvcGVydGllczw8L0Q8PC9SQkdyb3Vwc1tdL09OWzIyIDAgUl0vT3JkZXIgMjEgMCBSPj4vT0NH

–KkK170891tpbkKk__FV_KKKkkkjjwq–
.
250 Ok
quit
221 mycomputer closing connection

This discussion is locked

All Comments