Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Email-Groupwise
Message
 
 
À
29/10/2001 09:08:14
Ashish Patel
Hindustan Petroleum
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00562795
Message ID:
00574439
Vues:
19
>Hi
>
>I tried the Message "552031" on sending email from VFp for Novell Groupwise.
>
>I am really surprised to know that fox can talk to novell groupwise also.
>
>I am getting on one error when I send the attachment.
>For a test I crated following prog.
>
>=GW('ashishpatel.indbazaar.com","This is a Test Message ','C:\HPGAS\REGLOCK.DBF')
>
>retu
>
>PROCEDURE GW
>LPARAMETERS cSendTo,cSubject,cMessage,cAttachment
>oGW=CREATEOBJECT('NovellGroupwareSession')
>oMsg=oGW.Login.RootFolder.Messages.Add
>oMsg.Subject=cSubject
>oMsg.BodyText=cMessage
>oMsg.Attachments.Add(cAttachment)
>oMsg.Recipients.Add(cSendTo,'NGW','0')
>oMsg.Send
>RELEASE oGW
>
>
>I am getting error in the following line
>
>oMsg.Attachment.Add(cAttachment)
>
>The error message says
>
>Member ATTACHMENT does not evaluate to an object.
>
>
>Can You Pl. Help.
>
>Thanks in Advance.
>
>Ashish Patel

Hi Ashish,

This original message contained a typo. It should be ATTACHMENTS (see my change in bold).

Here is my version of this program:
********************************************************************
*  Description.......: MailWithGroupWise
*  Calling Samples...: MailWithGroupWise('nnosonov@thewarrengroup.com','SUBJECT HERE','TEXT MESSAGE HERE ','O:\REDP\OUTPUT\CUstomer\Fares\Trwc0122.zip')
*  Parameter List....: cSendTo,cSubject,cMessage,cAttachment
*  Created by........: Robert Peirce
*  Modified by.......: Nadya Nosonovsky 09/11/2001 01:37:42 PM
********************************************************************
lparameters cSendTo,cSubject,cMessage,cAttachment
local oGW, lcOldError, lnReturn
lcOldError=on('error')
on error lnReturn=-1
lnReturn=0
oGW=createobject('NovellGroupwareSession')
if vartype(oGW)='O' && Group Wise object was successfully created
     local oMsg, loRecipients, lnRecipients, lnI, lnAttachments
     oMsg=oGW.Login.RootFolder.messages.add
     oMsg.Subject=m.cSubject
     oMsg.BodyText=m.cMessage
     lnRecipients=alines(laRecipients,strtran(m.cSendTo,";",chr(13)))
     cAttachment=strtran(m.cAttachment,',',';') && Replace comma with semicolon
     lnAttachments=alines(laAttachments,strtran(m.cAttachment,";",chr(13)))
     for lnI=1 to m.lnRecipients
          cSendTo=laRecipients[m.lnI]
          if '@' $ m.cSendTo
               loRecipients=oMsg.Recipients.add(m.cSendTo,'NGW','0')
          else
               loRecipients=oMsg.Recipients.AddByDisplayName(m.cSendTo)
          endif
          loRecipients.Resolve()
     endfor
     for lnI=1 to m.lnAttachments
          cAttachment=laAttachments[m.lnI]
          if !file(m.cAttachment)
               =messagebox("File "+ m.cAttachment+" is not found!",48,'File not found')
               lnReturn=-1
               exit
          endif
          oMsg.Attachments.add(m.cAttachment)
     endfor
     if m.lnReturn=0 && No errors yet
          oMsg.send
     endif
     release oGW
else
     lnReturn=SendMails(,,m.cSendTo,m.cSubject,m.cMessage,m.cAttachment) && Wrapper for Nigel's class
endif
on error &lcOldError
return m.lnReturn
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform