Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mabry-MailX control
Message
From
18/12/2001 14:16:01
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
 
 
To
18/12/2001 13:19:42
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00595661
Message ID:
00595748
Views:
29
>>Has anyone used Mabry's MailX control to send email from VFP? After nixing just about every other option, I'm exploring this one as my last hope. Does anyone have any sample VFP code?
>
>Elyse,
>
>This is an oversimplified example, but hopefully it will get you started. Since you need authentication, you will change connectionType to 1, and you will need to add lines for the user name and password properties.
>
>Also, to make it more interactive and bulletproof during the sending process, you need to read the information on blocking and blocking mode on Mabry's website. They also have HTML examples.
>
>Create a form, and drop the MailX activeX on the form. In this example, I named the activeX control oSmtp. Put the following code in the click method of a command button. Add a property to the form called 'sending'.
>
>* command1.click()
>local lcSender, lcRecipient, lcSubject, lcBody
>
>lcRecipient = "recipient@somewhere.com"
>lcSubject = "test"
>lcBody = "testing..."
>
>if !thisform.sending
>
>    lcSender = "youremailaddress.somewhere.com"
>
>    thisform.sending = .t.
>    this.enabled = .f.
>    thisform.refresh()
>    with thisform.oSmtp
>        .ConnectionType = 0  && SMTP connection, set to 1 for ESMTP
>        .Blocking = .t.
>        .blockingMode = 1
>        .Host = "mail.yourhost.com"
>        .Connect
>        .sendMail(lcSender, lcRecipient, lcSubject, lcBody)
>        .disconnect
>    endwith
>    thisform.sending = .f.
>    this.enabled = .t.
>endif
>
This is a good start, but I'll need to send attachments, HTML text, etc., so I think I need to use the SendMessage() option. Anyone have any examples of that?
Elyse Pomerantz
Previous
Reply
Map
View

Click here to load this message in the networking platform