Beispiel #1
0
        public async Task SendInterFax()
        {
            // Update username/password in web.config to valid credentials first. Otherwise will throw 401:unauthorised

            var          username = ConfigurationManager.AppSettings["INTERFAX_USERNAME"];
            var          password = ConfigurationManager.AppSettings["INTERFAX_PASSWORD"];
            FaxClient    fc       = new FaxClient(username, password);
            string       filePath = System.Web.HttpContext.Current.Server.MapPath("sample.pdf");
            IFaxDocument ifd      = fc.Documents.BuildFaxDocument(filePath);
            SendOptions  so       = new SendOptions();

            so.FaxNumber  = "+99999990";
            so.PageHeader = "test";
            try
            {
                var result = await fc.Outbound.SendFax(ifd, so);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
 /// <summary>
 /// Submit a fax with a single document to a destination number.
 /// </summary>
 /// <returns>The messageId of the newly created fax.</returns>
 public async Task <int> SendFax(IFaxDocument faxDocument, SendOptions options)
 {
     return(await SendFax(new List <IFaxDocument> {
         faxDocument
     }, options));
 }