Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending Mail via SMTP
Message
 
À
29/06/2005 04:31:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01027287
Message ID:
01027297
Vues:
23
CDO uses SMTP (either SMTP service on the local machine or SMTP server). Here is an example using an SMTP server.
Local iMsg,iConf
Declare SHORT InternetGetConnectedState In wininet.Dll;
    INTEGER @lpdwFlags, Integer dwReserved
lConnect=displayState()
If lConnect
    iMsg = Createobject("CDO.Message")
    iConf = Createobject("CDO.Configuration")
    Flds = iConf.Fields
    With Flds
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 'Your SMTP server name here'
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Update
    Endwith
    With iMsg
        .Configuration = iConf
        .To = "me@hotmail.com"
        .CC = ""
        .BCC = ""
        .From = "me@somewhere.com"
        .Subject = "Ceci est un essaye"
        .TextBody = "Le corps du message"
        .AddAttachment( "C:/" + lcFilename) && Must be a valid file
        .Send
    Endwith
    iMsg = .Null.
    iConf = .Null.
    wb = .Null.
Else
    Messagebox("Impossible to send. No connection!")
Endif
Procedure  displayState
Local lConnected
lConnected = .F.
lpdwFlags = 0
If InternetGetConnectedState (@lpdwFlags, 0) = 1
    lConnected = .T.
Endif
Return lConnected
Endproc
>Hi all
>
>Is there a way to send email from Fox via SMTP, has anyone got any examples?
>
>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform