Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAPI Question
Message
Information générale
Forum:
Visual Basic
Catégorie:
Contrôles ActiveX
Titre:
Divers
Thread ID:
00859130
Message ID:
00859193
Vues:
15
This is not VB code! At least .T. and .F. have to be replaced with True and False.

To send e-mails, have a look at this free component: http://www.freevbcode.com/ShowCode.Asp?ID=109


>In the following code, I'm getting an "Unspecified error occured"
>on the line oMessages.Send()
>
>Anyone know what's wrong here?
>
>
>
>cLoginName = "loginname"
>cPassword = "password"
>cRecipient = "kmarois@comcast.net"
>cSubject = "Test Email"
>cBody = "This is a test
>*cAttachment = "d:\projects\vfp1\email\test.txt"
>
>
>oSession = CREATEOBJECT("MSMAPI.MAPISession")
>oMessages = CREATEOBJECT("MSMAPI.MAPIMessages")
>
>WITH oSession
>  .DownLoadMail = .T. 								
>  .LogonUI= .F.
>  .UserName = cLoginName
>  .Password = cPassword
>  .SignOn()
>ENDWITH
>
>
>oMessages.SessionID = oSession.SessionID
>oMessages.Compose()
>oMessages.RecipAddress = cRecipient
>oMessages.MsgSubject = cSubject
>oMessages.MsgNoteText = cBody
>oMessages.Send(.T.)
>
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform