How can i send fax using python when i have my own fax machine?

569 Views Asked by At

i have been trying to make a fax list and send them rapidly by python . all packages like phaxio , interfax,.. are sending fax through their own server but i have Panasonic fax and want to send fax by it. is there other packages to send fax using windows fax and scan? how can i send fax using my own fax machine?

1

There are 1 best solutions below

2
On

If your fax machine is compatible with the Windows Fax and Scan application and is linked to your computer through a USB or serial port, you may use the pywin32 package to automate sending faxes through the Windows Fax and Scan program.

import win32com.client

fax = win32com.client.Dispatch("FaxComEx.FaxDocument")
fax.Body = "Hello World!"
fax.Recipients.Add("1234567890")
fax.Subject = "Test Fax"
fax.FaxNumber = "1234567890"
fax.Send()

import win32api

win32api.ShellExecute(0, "faxsend", " /d 1234567890 testfax.txt", "", 0)

This will send the file testfax.txt as a fax to the number 1234567890.

Let me know if this works for you.