ASP.NET Fax – Simple Fax Transmission (VB.NET code)

25 Nov 2016 This code sample is deprecated and in process of being removed. Check out our new code libraries and usage documentation on InterFAX @ Github.

This example demonstrates how to send a fax with ASP, using VB.NET (.aspx.vb extension).

The SendCharFax method allows you to send a basic, plain-text fax from ASP. Text is limited to be standard ASCII (no 8-bit characters), but can include HTML markup.

The ASP.NET (.aspx.vb) fax code below submits a plain-text file to the Web service, and indicates whether the submission succeeded, in which case the return value is the (positive) transaction ID of the fax. Any other return value indicates a failure (for more details, see Web Service Return Codes).

Dim username As String = "my username"
        Dim password As String = "my password"
        Dim faxnumber As String = "+442079876543"
        Dim faxcontents As String = "This is my text"
        Dim ifws As New interfax.InterFax()
        Dim st As Long = ifws.SendCharFax(username, password, faxnumber, faxcontents, "txt")
        Response.Write("Status is " & st)