Filling an email with html

M

Michael Bauer

Am Sat, 14 Jan 2006 23:04:22 -0000 schrieb John:

You need to read the file´s content first. Sample:

Public Function ReadFile(sPath As String) As String
On Error GoTo AUSGANG
Dim lFileNr As Long
Dim sText As String

lFileNr = FreeFile

Open sPath For Binary As #lFileNr
sText = Space$(LOF(lFileNr))
Get #lFileNr, , sText

AUSGANG:
If lFileNr Then Close #lFileNr
If Err.Number Then Err.Raise &H800A0000 Or Err.Number, _
Err.Source, Err.Description, Err.HelpFile, Err.HelpContext
ReadFile = sText
End Function

Simply add the content then to the mail´s HTMLBody property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top