Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Call Netscape Messager from VFP
Message
De
13/07/2000 02:58:28
 
 
À
10/07/2000 02:30:18
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00390097
Message ID:
00391666
Vues:
11

Start playing with this:
IF NOT VFP_SendMailMapi("This is the subject", "This is the message.","yourname@yourdomain.com", "C:\TEMP\TEXTFILE.TXT")
 MESSAGEBOX("An error occured!", 48)
ELSE
 MESSAGEBOX("Operation succesfully completed.", 64)
ENDIF
 
FUNCTION VFP_SendMailMapi
LPARAMETER tcSubject, tcText, tcRecipient, tcAttachment
LOCAL loSession, loMessage, llAttachment, llSendAttachment, lcDataPath,lcOldError, llError
WAIT WINDOW NOWAIT "Creating email. Please wait."
lcOldError = ON("ERROR")
llSendAttachment = .F.
llAttachment = NOT EMPTY(tcAttachment)
llError = .F.
ON ERROR llError = .T.
IF llAttachment
 llSendAttachment = FILE(tcAttachMent)
 IF NOT llSendAttachment
  MESSAGEBOX("Error: file &tcAttachment not found.", 64, _screen.caption)
  llError = .T.
 ENDIF
ENDIF
IF NOT llError
 IF NOT EMPTY(tcRecipient)
  loSession = CREATEOBJECT("msmapi.mapisession")
  loMessage = CREATEOBJECT("msmapi.mapimessages")
  loSession.logonui = .T.
  loSession.downloadmail = .F.
     loSession.username = ''
     loSession.password = ''
  loSession.signon
  loSession.NewSession = .F.
  loMessage.sessionid = loSession.sessionid
  loMessage.MsgIndex = -1
  loMessage.Compose
  loMessage.RecipAddress = tcRecipient
  loMessage.ResolveName
  loMessage.msgsubject = IIF(NOT EMPTY(tcSubject), tcSubject, "")
  loMessage.msgnotetext = IIF(NOT EMPTY(tcText), tcText, "")
  IF llSendAttachment
   loMessage.attachmentindex = 0
   loMessage.attachmentpathname = tcAttachment
  ENDIF
    loMessage.send
  loSession.signoff
 ELSE
  MESSAGEBOX("Error: no recipient!", 64, _screen.caption)
  llError = .T.
 ENDIF
ENDIF
WAIT CLEAR
RETURN NOT llError
ENDFUNC

Dave



>Dear all,
>
>I would like to call the Netscape Messager and create a new mail automatically. And I need to predefine the message text and attached file. User just only to fillin the recipient name or select the recipient from Netscape's Address Book. Thank you for your help.... I can use MAPI class to send the mail but the recipient cannot selected from Netscape's Address Book. User must enter the name by themself. Therefore, I would like to prompt the mail window to need them entered infromation. Thanks a lot!!
>
>Best Regards,
>
>Justy Chow
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform