public static string SendFaxV3(string _documentName, string _fileName, string _recipientName, string _faxNumber,
            string _faxIdentifier,string _sendID)
        {
            if (_faxNumber != "")
            {
                try
                {
                    FAXCOMLib.FaxServer faxServer = new FAXCOMLib.FaxServerClass();
                    faxServer.Connect(Environment.MachineName);

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

                    faxDoc.RecipientName = _recipientName;
                    faxDoc.FaxNumber = _faxNumber;
                    faxDoc.DisplayName = _documentName;


                    faxDoc.BillingCode = _sendID;

                    int Response = faxDoc.Send();

                    faxServer.Disconnect();
                    return "OK";

                }
                catch (Exception Ex)
                {
                    Common.Log(Ex.Message);
                    return Ex.Message;
                }
            }
            else
            {
                return "No number";
            }
        }
Esempio n. 2
0
    protected void btnSendFax_Click(object sender, EventArgs e)
    {
        FAXCOMLib.FaxServerClass fsc = new FAXCOMLib.FaxServerClass();
        fsc.Connect("MyMachineName");

        object obj = fsc.CreateDocument(@"Irfan.txt");
        FAXCOMLib.FaxDoc fd = (FAXCOMLib.FaxDoc)obj;
        fd.FaxNumber = txtCnty.Text + txtarea.Text + txtfax.Text;
        fd.RecipientName = "irfan";
        int i = fd.Send();
    }