user1457065
user1457065

Reputation:

RightFax 10.0 Integration With C#

If I insert the values into the corresponding tables of RightFax, does it FAX automatically or do i need to write the following code for that?

RFCOMAPILib.FaxServerClass faxserver = new RFCOMAPILib.FaxServerClass(); 
faxserver.ServerName = "ServerName"; 
faxserver.Protocol = RFCOMAPILib.CommunicationProtocolType.cpNamedPipes; 
faxserver.UseNTAuthentication = RFCOMAPILib.BoolType.True; 
faxserver.OpenServer(); 

RFCOMAPILib.Fax fax = (RFCOMAPILib.Fax) faxserver.get_CreateObject(RFCOMAPILib.CreateObjectType.coFax); 

// set up your 'fax' object the way you want it, below is just some sample options 
fax.ToName = "John Doe"; 
fax.ToFaxNumber = "4255551111"; 
fax.ToVoiceNumber = "4255550000"; 
fax.ToCompany = "ACME"; 
fax.FromName = "My Company"; 
fax.FromVoiceNumber = "4255552222"; 

fax.Send(); 

Can you please provide me sample code for attachments? If RightFax sends the FAX automatically then which tables do I need to fill-in in order to do that?

Thanks

Upvotes: 1

Views: 2152

Answers (1)

Michael
Michael

Reputation: 21

the below code is vb.net but will show you how to send a fax and add attachment as well, hope this helps. I've written a post about this here but here's the code below ....

Dim FaxAPI As RFCOMAPILib.FaxServer
Dim fFax As RFCOMAPILib.Fax
FaxAPI = New RFCOMAPILib.FaxServer
FaxAPI.ServerName =something
FaxAPI.Protocol = RFCOMAPILib.CommunicationProtocolType.cpTCPIP
FaxAPI.UseNTAuthentication = RFCOMAPILib.BoolType.False
FaxAPI.AuthorizationUserID = something
FaxAPI.AuthorizationUserPassword = something
FaxAPI.OpenServer()
fFax = FaxAPI.CreateObject(RFCOMAPILib.CreateObjectType.coFax)
fFax.Attachments.Add(“D:\FilePickupIn\2222222222-20110322142718-01.tif”)
fFax.HasCoversheet = RFCOMAPILib.BoolType.False
fFax.ToFaxNumber = something
fFax.ToName = something
fFax.Send()
FaxAPI.CloseServer()
FaxAPI = Nothing
fFax = Nothing

happy to help if you get stuck with anything...

Upvotes: 1

Related Questions