UUEncode

The UUEncode function does UU binary file encoding.

UUEncode

Parameters

The function has no parameters.

Return value

The sunsequent function callings return encoded ASCII strings, string by string. The empty string means there are no more data.

Notes

The UUEncodeStart function should be called before.
The remote client (mail/news reader) will understand your message only if you have sent the begin <number> filename string before and the ` and end strings just after encoded data. Do not forget to send CR/LF pair in the end of every string of encoded data.

Example
This example contains a part of ASP script with minimal code required to send file using UU encoding. The error checkings are omitted to make script more simple.

<%
............
Set tcpip=CreateObject("SHOTIP.Connection")
eol=Chr(13)&Chr(10)

Main()

Sub Main()
......... Here are opening connection to host (SMTP or NNTP) ...
......... Sending the neccesary defined by protocol commands ...
' Start encoding
tcpip.UUEncodeStart("c:\pict.jpg")
' Sending header
tcpip.Send "Subject: Sending an image" & eol
tcpip.Send eol
' The header is sent, uuencoding and sending body:
tcpip.Send "Test example - picture" & eol
tcpip.Send "begin 466 pict.jpg"
Do While True
	str=tcpip.UUEncode()
	if str="" then Exit Do
	tcpip.Send str & eol
Loop
tcpip.Send "`" & eol
tcpip.Send "end" & eol
......... Sending the neccesary defined by protocol commands ...
End Sub
%>