Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir,
bellow is my code for send fax.but its generates error The data is invalid. (Exception from HRESULT: 0x8007000D).
please help me if any one knows the answer
C#
public void SendFax(string DocumentName, string FileName, string RecipientName, string FaxNumber)
       {
           if (FaxNumber != "")
           {
               try
               {
                   FAXCOMLib.FaxServer faxServer = new FAXCOMLib.FaxServer();
                       faxServer.Connect(Environment.MachineName);


                   FAXCOMLib.FaxDoc faxDoc = (FAXCOMLib.FaxDoc)faxServer.CreateDocument(FileName);

                   faxDoc.RecipientName = RecipientName;
                   faxDoc.FaxNumber = FaxNumber;

                   faxDoc.DisplayName = DocumentName;


                   int res = faxDoc.Send();

                   Label1.Text = res.ToString();
                   faxServer.Disconnect();

               }
               catch (Exception Ex) { throw (Ex); }
           }
       }

       protected void Button1_Click(object sender, EventArgs e)
       {
           SendFax(txtdocname.Text,Server.MapPath("~/"+FileUpload1.FileName),txtrecipentname.Text, txtfax.Text);
       }
Posted
Updated 19-Nov-13 1:00am
v2
Comments
Bernhard Hiller 19-Nov-13 6:52am    
In which line?
And: did you check that the document exists on the server in the expected folder with that name?
vineethnair 19-Nov-13 23:39pm    
ya..i checked..error occured in the line faxdoc.send()
Member 7800303 24-Dec-13 7:56am    
error occured on send method
Savalia Manoj M 23-Feb-17 7:27am    
FAXCOMLib support .tif file format. Please change file extension and try again

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900