Fax VB.NET – Send Plain-Text Fax with SendCharFax

Download the fax VB.NET project files.

This sample shows you how to send a plain-text fax with VB.NET. This is done using the SendCharFax method. Text is limited to standard ASCII (no 8-bit characters).

HTML markup can be used, but note that HTML causes automatic word wrapping, whereas regular text does not.

In the following fax VB.NET code snippet, a plain-text file is submitted to the Web service, and an indication of the submission status is received: Upon a successful submission, the system returns the transaction ID (positive number) of the fax, where any other return value indicates failure. For more details, see Web Service Return Codes.


Sub Main()
        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")
        Console.WriteLine("Status is " & st)
    End Sub