Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to send messages with OUTLOOK
Message
De
26/06/2002 03:02:36
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russie
 
 
À
26/06/2002 02:26:15
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00672333
Message ID:
00672338
Vues:
9
Why don't you use the regular mapimess, mapisess actiive X, they will mail thougth any available mail server, and outlook also
Scan dir with wild card sys(2001,) for files you need to mail
and this is all.
Set files like mail atacment
I send mail directly from VFP forms , based on the forms nontents , gathring it into html file and put it in the mail atachment. There is the sample of using mapi inside VFP samples, 2 controls in the button, just make button click programatically.
For outlookexpress you can not write createobject, you can write it only for outlook itself
the code looks like
loSession=this.olemsess
loSession.logonui = .T.
loSession.downloadmail = .F.
loSession.username = ''
loSession.password = ''
loSession.signon() && Use the custom method
*!* Return
*
lcMessageText=''
loSession.NewSession = .F.
This.OleMMess.sessionid=this.olemsess.sessionid
* Get the number of fields in the current table

*!* loSession.signon

*!* 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 lnFileCount > 0
*!* FOR lnCount = 1 TO lnFileCount
*!* loMessage.attachmentindex = lnCount - 1
*!* loMessage.attachmentpathname = laFiles[lnCount]
*!* loMessage.AttachmentPosition = lnCount - 1
*!* ENDFOR
*!* ENDIF
*!* loMessage.send
*!* loSession.signoff
This.OleMMess.MsgIndex = -1
lcMessageText=_tv

If empty(_mll.mladr[1])
* Start a new mail message and build the text
This.OleMMess.compose
*!* If not empty(alltrim(this._txht))
*!*
*!*
*!* *!* this.OleMMess.AttachmentIndex = 1
This.OleMMess.AttachmentPathname = _dir+_fln
*!* *!* this.OleMMess.AttachmentName = _fln

*!* Endif
This.OleMMess.msgtype='html/Text'
This.OleMMess.RecipAddress=m.adr
This.OleMMess.ResolveName

If not used('_sopr') or empty(alltrim(_sopr.spr))
This.OleMMess.msgnotetext=' '
Else
This.OleMMess.msgnotetext=_sopr.spr
Endif
This.OleMMess.msgsubject=this.subj
*!* This.OleMMess.save()
This.OleMMess.send()
If file(_dir+_fln)
Delete file (_dir+_fln)
Endif
Else
For ii=1 to alen(_mll.mladr,1)
m.adr=_mll.mladr
This.OleMMess.compose
*!* this.OleMMess.AttachmentIndex = 1
This.OleMMess.AttachmentPathname = _dir+_fln
This.OleMMess.msgtype='html/text'
This.OleMMess.RecipAddress=m.adr
This.OleMMess.ResolveName

If not used('_sopr') or empty(alltrim(_sopr.spr))
This.OleMMess.msgnotetext=' '
Else
This.OleMMess.msgnotetext=_sopr.spr
Endif

*!* this.OleMMess.AttachmentIndex = 1
*!* this.OleMMess.AttachmentPathname = sys(5)+sys(2003)
*!* this.OleMMess.AttachmentName = _fln
This.OleMMess.msgsubject=this.subj

*!* This.OleMMess.save()
Endfor
This.OleMMess.send()
MVP-2006-2011, PHD in Math and Physics ,
host of www.foxclub.ru,
VFP lector at Interface and Microinform companies
Head science researcher of VNIIA Rosatom.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform