question

Murthy TLN avatar image
Murthy TLN asked Anirban answered

How to send Fax attaching pdf in RingCentral in Java

We were exploring RingCentral fax for sending fax. We wanted to attach pdf docs and send it with Java code. But with RingCentral SDK I just wanted to know how do set the mime type or content type in the code. Any example will be helpful.


I tried :

`Attachment attachment = new Attachment();

attachment.fileName = "c:\\ testRun.pdf";`


Is there any way to set the document mime type?


getting started
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Anirban avatar image
Anirban answered

If you can check the sample document here, attachment.contentType is for setting the document content type: https://developers.ringcentral.com/guide/messaging/fax/sending-faxes

Attachment attachment = new Attachment();
attachment.fileName = "testRun.pdf";
attachment.contentType = "application/pdf";
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys