<%@ Page Language="vb" %> ' 'The strFileType is a constant in this sample. ' Dim objWS As Interfax.Interfax 'Reference to local webservice proxy connector Dim SendFaxResult as integer objWS = new Interfax.Interfax Dim fs As System.IO.FileStream 'Reference to Filestream object ' ' Read data from binary file (PDF, Word, ...) ' Make sure the file exists and ASPX script has access to the file. ' fs = IO.File.Open("C:\temp\1.pdf", IO.FileMode.Open, IO.FileAccess.Read) ' ' Allocate a byte array accoording to file length ' Dim FilesData(fs.Length - 1) As Byte ' ' Read the entire file ' fs.Read(FilesData, 0, fs.Length) ' ' Cleanup Stream ' fs.Close fs = Nothing ' ' Obtain the file type ' objWS.SendfaxEx_2( "", "", "+1 212 345 6789", "", FilesData, _ "PDF", FilesData.Length, Now, 3, "MyCSID", "", "", "Fax Subject", "myaddress@mydomain.com", _ "Letter", "Landscape", False, True) objWS = Nothing If SendFaxResult > 0 Then Response.Write("Fax submitted. Transaction ID: " & SendFaxResult) Else Response.Write("Error sending fax. Return code: " & SendFaxResult) End If %>