Hi Samuel,
To attach files you have to form multi-part message. Here is how the headers of such message should look like:
Mime-Version: 1.0
Importance: Normal
Return-Path: info@foxpro.com
Disposition-Notification-To: "Jane Brown"
X-AnyHeader: any value for this header
To: "Andrew"
Cc: "Laura" , "Nicole"
Content-Type: multipart/mixed; boundary="6BE113A6-54C8-4D27-B8E0-9E8FD1ACD512"
Message-ID:
From: "FoxPro developer"
Subject: Test message
X-Mailer: Visual FoxPro 08.00.0000.3117 for Windows
The Content-Type header makes a difference.
Make yourself familiar with message parts and boundaries: how to properly assign headers Content-Type, Content-Transfer-Encoding and Content-Disposition for them.
There are several RFC standards you probably should look through:
http://www.faqs.org/rfcs/rfc821.html
http://www.faqs.org/rfcs/rfc1521.html
http://www.faqs.org/rfcs/rfc2387.html
http://www.faqs.org/rfcs/rfc2112.html
...
For me, even before reading those RFCs, the best way was opening Outlook Express and looking through message sources. Once you understand what's going on inside a typical message, you are able to assemble similar message in your FoxPro code.
Recently I finished working on SendEmail VFP class, it's being tested now (hopefully). It allows to assemble multipart/mixed and multipart/alternative messages and send then either through Windows socket connected to SMTP server or through Hotmail/MSN server using HTTP.
In 1-2 weeks I plan to post this class either to my web site or to download sections of other sites. The class performs much better comparing to the code sample you are probably familiar with:
Winsock: sending email messages (SMTP, port 25)
http://www.news2news.com/vfp/?example=385