Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending mails through GroupWise with attachment
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00542261
Message ID:
00552164
Vues:
58
>Thanks for the correction... Since this is a Novell API, your administrator shouldn't complain :)

Hi Robert,

I continued my tests and I found, that I can not use name as it appears in GroupWise. In other words, if I use the whole address like nnosonov@thewarrengroup.com, it works, but when I tried "Nosonovsky" instead, it gave me Ole IDispatch error 0: User not found.

Sorry, disregard. I made one additional little correction:
********************************************************************
*  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.......:
********************************************************************
lparameters cSendTo,cSubject,cMessage,cAttachment
oGW=createobject('NovellGroupwareSession')
if vartype(oGW)='O' && Group Wise object was successfully created
     local oMsg, loRecipients, lnRecipients, lnI
     oMsg=oGW.Login.RootFolder.messages.add
     oMsg.Subject=m.cSubject
     oMsg.BodyText=m.cMessage
     oMsg.Attachments.add(m.cAttachment)
     lnRecipients=alines(laRecipients,strtran(m.cSendTo,";",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
     oMsg.send
     release oGW
else
     return SendMails(,,m.cSendTo,m.cSubject,m.cMessage,m.cAttachment)
endif
>
>Bob
>
>>>Hello Nadya and Sandy,
>>>
>>>Thanks for the code snippet, worked OK but I streamlined it abit. I am using
>>>
>>>=GW('RPierce@Smooth-On.com','SUBJECT HERE','TEXT MESSAGE HERE ','C:\PICT.JPG')
>>>
>>>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
>>>
>>>If you look on Novell's site using 'NovellGroupwareSession' as a search you get some relevant stuff with examples with tons of code, boils down to the above and works well for me.
>>>
>>>Thanks Sandy
>>
>>I tried this code and it works fine on my machine (I corrected Attachment to Attachments). I haven't searched Novell site yet, but I think, this would be enough.
>>
>>Thanks a lot to everyone.
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