how can i ensure an email will wrap at 72 characte

# Thread: how can i ensure an email will wrap at 72 characte

1. Member
Join Date
Dec 1969
Posts
98

## how can i ensure an email will wrap at 72 characte

how can i ensure the email will wrap at 72 characters when im pulling information from a database to populate the body of the email and so therfore wont know the length until they are passed in?

2. Senior Member
Join Date
Dec 1969
Posts
1,203

## RE: how can i ensure an email will wrap at 72 char

Something like this should get you started:<BR><BR>sTest = "A1234567890 B1234567890 C1234567890 D1234567890 E1234567890 F1234567890 G1234567890 H1234567890 I1234567890 J1234567890 K1234567890 L1234567890 M1234567890 N1234567890 O1234567890 A1234567890 B1234567890 C1234567890 D1234567890 E1234567890 F1234567890 G1234567890 H1234567890 I1234567890 J1234567890 K1234567890 L1234567890 M1234567890 N1234567890 O1234567890 A1234567890 B1234567890 C1234567890 D1234567890 E1234567890 F1234567890 G1234567890 H1234567890 I1234567890 J1234567890 K1234567890 L1234567890 M1234567890 N1234567890 O1234567890"<BR>sOut = ForceWrap(sTest, 30)<BR>Response.Write sOut<BR><BR>Function ForceWrap(sToWrap, iCols)<BR>Dim iCrLf, iLen<BR>iCrLf = Instr(sToWrap,vbCrLf)<BR>iLen = Len(sToWrap)<BR><BR>If iCrLf &#062; iCols Or iCrLf = 0 Then<BR>sOut = Left(sToWrap,iCols) & vbCrLf<BR>Else<BR>sOut = sToWrap<BR>End If<BR><BR>If iLen &#062; iCols Then<BR>sOut = sOut & ForceWrap(Right(sToWrap,iLen-(iCols)), iCols)<BR>End If<BR><BR>ForceWrap = sOut<BR><BR>End Function

3. Senior Member
Join Date
Dec 1969
Posts
1,203

## Correction

sTest = "A1234567890 B1234567890 C1234567890 D1234567890 E1234567890 F1234567890 G1234567890 H1234567890 I1234567890 J1234567890 K1234567890 L1234567890 M1234567890 N1234567890 O1234567890 A1234567890 B1234567890 C1234567890 D1234567890 E1234567890 F1234567890 G1234567890 H1234567890 I1234567890 J1234567890 K1234567890 L1234567890 M1234567890 N1234567890 O1234567890 A1234567890 B1234567890 C1234567890 D1234567890 E1234567890 F1234567890 G1234567890 H1234567890 I1234567890 J1234567890 K1234567890 L1234567890 M1234567890 N1234567890 O1234567890" <BR>sOut = ForceWrap(sTest, 30) <BR>Response.Write sOut <BR><BR>Function ForceWrap(sToWrap, iCols) <BR>Dim iCrLf, iLen, iNew<BR><BR>iCrLf = Instr(sToWrap,vbCrLf) <BR>iLen = Len(sToWrap) <BR><BR>If iCrLf &#062; iCols Or iCrLf = 0 Then <BR>sOut = Left(sToWrap,iCols) & vbCrLf <BR>iNew = iCols<BR>Else <BR>iNew = iCrLf<BR>sOut = Left(sToWrap,iCrLf)<BR>End If <BR><BR>If iLen &#062; iCols Then <BR>sOut = sOut & ForceWrap(Right(sToWrap,iLen-(iNew)), iCols) <BR>End If <BR><BR>ForceWrap = sOut <BR><BR>End Function <BR><BR>Sorry for the confusion. Still may not be perfect, but it&#039;s a start...

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•