Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAPI-How to send all mail at once?
Message
 
 
À
01/04/2002 14:16:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00637662
Message ID:
00639807
Vues:
24
This modified code from my website works perfectly for me. At each Send() it propmpts with the new anti-virus feature in OE6 "A program is attempting to send the following e-mail message on your behalf" When I click the Send button the email gets sent.
activate window "debug output"

* simple test email program using MAPI

oleMAPISession = createobject( "MSMAPI.MAPISession.1" )

* Signon to mail
with oleMAPISession
   .UserName = "Test"
   .Password = ""
   .Signon()
   * Check the SignOn status
   if ( .SessionID > 0 )
      oleMAPIMessages = createobject( "MSMAPI.MAPIMessages.1" )
      * tell the message the SessionID
      oleMAPIMessages.SessionID = .SessionID
      debugout "Successful mail log on"
   else
      debugout "Mail login failed"
      return
   endif
endwith

* Send an email

with oleMAPIMessages
   .Compose()

   * Set the Recipient name and resolve
   .RecipDisplayName = "DavidFrankenbach@worldnet.att.net"
   .RecipType = 1
   .ResolveName()

   .MsgSubject = "This is the Subject"
   .MsgNoteText = "This is the email text"

   .Send( .f. )
endwith

* send another email

with oleMAPIMessages
   .Compose()

   * Set the Recipient name and resolve
   .RecipDisplayName = "DavidFrankenbach@worldnet.att.net"
   .RecipType = 1
   .ResolveName()

   .MsgSubject = "This is the Subject2"
   .MsgNoteText = "This is the email text2"

   .Send( .f. )
endwith

* Signoff

oleMAPISession.Signoff()
From what I can read in the mapi98.chm file, there can only be one message in the Compose buffer at a time. So you have to issue a Send() for every email message.

>You suggestion did not change the situation. Thank you for reply.
>I found that oMessage.Send() event will only working once, then do nothing, unless restart VFP.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform