Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mabry-MailX control
Message
De
18/12/2001 13:19:42
 
 
À
18/12/2001 11:44:47
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00595661
Message ID:
00595724
Vues:
34
>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
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform