Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Internet Mail Activex Controls by Mabry.
Message
From
14/05/1998 22:23:30
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Internet Mail Activex Controls by Mabry.
Miscellaneous
Thread ID:
00099641
Message ID:
00099641
Views:
93
Hi,

I've been trying to get the Active controls provided by Mabry for Internet Mail to work correctly. What I'm trying to do is quite simple. I want to attach 1 file to a message and send it out via TCP/IP. Everything works OK except for the fact that my message has no text in the body, and double-clicking on my attached file does not do open it. It doesn't do anything. My e-mail goes to the approproate recipents, but the message text is not displayed and the attachment can not be retrieved. Can anyone, help me. Following is my code. If someone has experince with Mabry Activex conrols, can they please re-check this:

---------------------CODE-------------------------------------------
#define MailActionNewMessage 11
#define MailActionCreatePart 4
#define MailActionDescend 7

#define MailSrcIsBuffer 1
#define MailSrcIsFile 2
#define MailSrcIsHost 4
#define MailSrcIsBody 8

#define MailDstIsBuffer 16
#define MailDstIsFile 32
#define MailDstIsHost 64
#define MailDstIsBody 128

#define ReadHeaderOnly 256

#define MailActionEncode 9
#define MailActionAscend 2
#define MailConnectTypeSMTP 0
#define MailActionConnect 3
#define MailActionWriteMessage 15
#define MailActionDisconnect 8

LOCAL liBoundary

_VFP.AutoYield = .F.

RAND(-1)
WITH ThisForm.OLEMabryControls

.Action= MailActionNewMessage
.Date=LEFT(CDOW(DATE()),3)+", "+STR(DAY(DATE()),2)+" "+LEFT(CMONTH(DATE()),3)+" "+STR(YEAR(DATE()),4)+" "+TIME()
.From="John Vlahos"
.EmailAddress="vlahosj@total.net"
.TO="slarin@hotmail.com,louis-jean_bluteau@videoway.com,beaulieuc@transcontinental.ca,j_vlahos@hotmail.com"
.CC="vlahosj@total.net,slarin@total.net"
.BCC=""
.Subject="Home: Mabry Mail Controls"
DOEVENTS()

*Create the headers for the message
liBoundary=INT(RAND()*100000000000)
.ContentType="multipart"
.ContentSubType="mixed"
.ContentSubTypeParameters="boundary="+STR(liBoundary)+"_boundary"
.MultipartBoundary=STR(liBoundary)+"_boundary"

*This is the first attachment!!!!
.Action=MailActionCreatePart
.Action=MailActionDescend
.ContentType="image"
.ContentSubtype="jpeg"
.ContentSubtypeParameters='name="ms.jp"'
.ContentTransferEncoding="base64"
.ContentDisposition='inline; filename="ms.jpg"'
.Flags=MailSrcIsFile + MailDstIsBody
.SrcFilename="c:\email\ms.jpg"
.Action=MailActionEncode
.Action=MailActionAscend
DOEVENTS()

*This is the body (text) of the message!!!
.Action=MailActionCreatePart
.Action=MailActionDescend
.ContentType="text"
.ContentSubtype="plain"
.ContentSubTypeParameters="charset=us-ascii"
.ContentTransferEncoding="7bit"
.Body(0)="I will be very happy if this works!!!!!"
.Action=MailActionAscend
DOEVENTS()

*Basic Host configuration
.Blocking = 1
.Host="mail.total.net"
.LogonName=""
.LogonPassword=""
.ConnectType=MailConnectTypeSMTP

*!* .Headers(.HeadersCount)="X-Mailer: Mabry "
*!* .MessageID=DTOS(DATE())+" _Mabry"

*Finally, Send the message, with the attachments!!!!
.Action=MailActionConnect
DOEVENTS()
.Flags=MAilSrcIsBody + MailDstIsHost
.Action=MailActionWriteMessage
DOEVENTS()

.Action=MailActionDisconnect
DOEVENTS()
ENDWITH

ThisForm.Release()

---------------------ENDCODE----------------------------------------
Thanks
JOhn Vlahos
Reply
Map
View

Click here to load this message in the networking platform