Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending e-mail automatically.
Message
From
14/05/1998 19:48:02
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
 
 
To
13/05/1998 17:10:39
Todd Zmetana
Night Owl Projects
Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00098803
Message ID:
00099632
Views:
22
Hi Todd,

Thanks for your advice. I downloaded the Internet Mail Activex controls from Mabry. I added my code to my form to utilize these methods and properties.
I am at the point where I send the message out via TCP/IP. The two problems I am encountering as a recipient are:
1. The message contains no text in the body. Context length=0.
2. The attachment seems to be attached but I can not view it when I double-
click on it in my message.
Since you have already used the controls from Mabry, can you verify the code for me, correct and/or suggest anything better?
------------------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="logonname"
.LogonPassword="logonpassword"
.ConnectType=MailConnectTypeSMTP


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

.Action=MailActionDisconnect
DOEVENTS()
ENDWITH

ThisForm.Release()
------------------ENDCODE------------------------------------------------
Thank you,
John Vlahos

VI SOFTWARE SOLUTIONS DESIGN
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform