I finally got it working! I have included the code for you:
*-- Place a DBF file in the temp directory
cAttachName = 'MAD'+RIGHT(MadHatter.cFdr_Merch_No,5)+'.DBF'
cAttachSource = TRIM(GETENV('TEMP'))+'\'+cAttachName
SELECT MadMail
COPY TO (cAttachSource) TYPE FOX2X
USE
*-- Create the E-Mail message.
IF TYPE('oSession') <> 'O'
oSession = CREATEOBJECT('MAPI.Session')
oSession.Logon("Windows Messaging Settings",.f.)
ENDIF
*-- Create the email subject line.
cEmailSubject = 'Merchant Account Detail for '+DTOC(DATE())+'. File Number: '
cEmailSubject = cEmailSubject + RIGHT(MadHatter.cFdr_Merch_No,10)
*-- Create text to go in the actual email.
cEmailText = CRLF+MadWork.Name_Block+CRLF+CRLF
IF !EMPTY(TextBlock)
cEmailText = cEmailText + TextBlock+CRLF
ENDIF
oMessage = oSession.OutBox.Messages.Add()
oMessage.Subject = cEmailSubject
oMessage.Text = cEmailText
oAttach = oMessage.Attachments.Add()
WITH oAttach
.Type = 1
.Name = cAttachSource
.ReadFromFile(cAttachSource)
ENDWITH
oAttach.Name = cAttachName && Overwrite placeholder.
oRecipient = oMessage.Recipients.Add()
WITH oRecipient
.Name = TRIM(MadHatter.cEmail)
.Address = 'SMTP:'+TRIM(MadHatter.cEmail)
.AddressEntry.Type = "SMTP"
.AddressEntry.Address = TRIM(MadHatter.cEmail)
ENDWITH
oMessage.Update()
oMessage.Send(.T.,.F.)
Good Luck!