FastFiber

Email zenden vanuit Visual lisp

Gestart door WebRacer, zo 26 06 2005, 22:28:54

Vorige topic - Volgende topic

WebRacer

tja, HofCad, ik zou het niet weten nee....
ik denk dat je daarvoor meer bij windows moet zijn...

:?:
?

Kenny H

Citaat van: WebRacerMet jullie hulp kwam ik reeds tot hier...
Nu zou enkel nog de mail moeten verzonden worden zonder dat de
gebruiker dit nog hoeft te doen... Als dat mogelijk is tenminste,
Maar ik Weet Dat Alles Mogelijk Is...
Door jullie zit ik al zover..

;met wat hulp van David M. Stein
;probeerde ik dit
;CdLspOlivier = de tekst die ik wil verzenden
(defun sendmail (/ Mail)
(cond
 (
  (setq mail (strcat "mailto:Olivier.Hautekeete@telenet.be"
          "?Subject=Dit is het onderwerp."
          "&body=" CdLspOlivier
         )
  )
  (setq IShell (vlax-create-object "Shell.Application.1"))
  (setq imail (vlax-invoke-method IShell "ShellExecute" mail))
  (vlax-release-object IShell)
 )
)
(princ)
)

Als ik u programma laat lopen krijg ik een error

Command: sendmail
; error: bad argument type: stringp nil


Citeer(defun c:sendmail (/ Mail)
 (cond
   (
    (setq mail   (strcat "mailto:Olivier.Hautekeete@telenet.be"
;;;"?Subject=Dit is het onderwerp."
;;;"&body=" CdLspOlivier
)
    )
(setq IShell (vlax-create-object "Shell.Application.1"))    
(setq IShell (vlax-create-object "Shell.Application"))  
    (setq imail (vlax-invoke-method IShell "ShellExecute" mail))
    (vlax-release-object IShell)
   )
 )
 (princ)
)

Dan gaat dit wel. Als ik die

;;;"?Subject=Dit is het onderwerp."
;;;"&body=" CdLspOlivier

in commentaar leg start mijn outlook wel op.

Nu nog een andere vraag.

Shell.Application.1

waarvoor dient die 1?

Zowel met de orange als de blauwe regel heb ik geen problemen.
8) Volvo 4 Life 8)

Kenny H

Het programma van WebRacer klopte bijna. Er stond nog 1 klein foutje in.
Via animate wist ik dat de fout in het blokje setq mail lag. En dan is het maar uitproberen tot het lukt. :lol:

Citeer(defun c:sendmail (/ Mail)
 (cond
   (
    (setq mail   (strcat   "mailto:Olivier.Hautekeete@telenet.be"
         "?Subject=Dit is het onderwerp."
         "&body=CdLspOlivier"
;;;Error
;;; "&body=" CdLspOlivier
;;; de haakje stonden niet correct
      )
    )
    (setq IShell (vlax-create-object "Shell.Application.1"))
;;;     of
;;; (setq IShell (vlax-create-object "Shell.Application"))    
    (setq imail (vlax-invoke-method IShell "ShellExecute" mail))
    (vlax-release-object IShell)
   )
 )
 (princ)
)
8) Volvo 4 Life 8)

Kenny H

Beste HofCAD

Ik zou bij God niet weten waar het verschil zou liggen.
8) Volvo 4 Life 8)

WebRacer

kenny, bij mij werkte het... de CdLspOlivier  was waar de tekst in zat...sorry voor de verwarring
;met wat hulp van David M. Stein
;probeerde ik dit
;CdLspOlivier = de tekst die ik wil verzenden

en de Shell.Application.1 weet ik niet vanwaar de 1 komt, oplossing zo gegeven... mss te maken met welke soort mail-programma dient opgeroepen te worden?
?

Kenny H

Ah oké

Ik had het anders begrepen, mijn excuus daarom. Ik dacht dat ge de TEKST CdLspOlivier wou verzenden.

u schreef:
CdLspOlivier = de tekst die ik wil verzenden.

Als we elkaar begrijpen ist in orde hé.
8) Volvo 4 Life 8)

WebRacer

ja das duidelijk....in CdLspOlivier zit een code die opgevraagd word, vervormt word, en tenslotte naar mij moet worden gemaild...

dus de code zit in CdLspOlivier. (is voor beveiliging van Lisp-routines)

hoi even gezocht naar Shell.Application.1 en Shell.Application, beiden zijn hetzelfde, nl. Shell Automatiseringsservice voor windows (register-actie).
?

Kenny H

Nu mss een domme vraag maar waar vindt ge die info over Shell.Application.1  enz.
Is dat in de help van Lisp of VBA, van autocad?

MVG

Kenny
8) Volvo 4 Life 8)

WebRacer

opgelet, alles wat met het register te maken heeft is gevaarlijk en  te toegankelijk voor onbekenden op dat gebied!!:

1 opzoeken in het register van windows,
2 opzoeken op i-net naar register applicaties - shell.application
3 boeken over windows
?

WebRacer

Wat is shell-toegang?
Onder shell-toegang of shell access verstaat men de mogelijkheid om op een computersysteem van op afstand commando's uit te voeren. Om dit te verwezenlijken dient men gebruik te maken van een protocol zoals Telnet of SSH en bijhorende programmatuur.

http://support.one2web.be/?0021a#0006
?

Kenny H

Bedankt voor deze uitleg.


Groeten

Kenny
8) Volvo 4 Life 8)

HofCAD

Citaat van: WebRacerWat is shell-toegang?
Onder shell-toegang of shell access verstaat men de mogelijkheid om op een computersysteem van op afstand commando's uit te voeren. Om dit te verwezenlijken dient men gebruik te maken van een protocol zoals Telnet of SSH en bijhorende programmatuur.

http://support.one2web.be/?0021a#0006



Beste WebRacer en Kenny H,

Windows NT help geeft:


Shell

Specifies the name and location of an alternate command interpreter you want Windows NT to use for the MS-DOS subsystem.
shell=[[drive:]path] filename [parameters]

Parameters

[[drive:]path] filename
Specifies the location and name of the command interpreter you want Windows NT to use.
parameters
Specifies any command-line parameters or switches that can be used with the specified command interpreter.


Shell--Notes

Default setting

By default, the MS-DOS subsystem uses a special version of COMMAND.COM that works seamlessly with the other Windows NT subsystems (including piping and redirection between subsystems); the shell command is unnecessary.
Although it is not recommended, you can use the shell command to specify your own 16-bit command interpreter.

Using switches with a command interpreter

The shell command itself does not accept any switches, but if the command interpreter does, you can include them on the shell command line.



Shell--Examples

Suppose the file NEWSHELL.COM is in a directory named BIN on your startup drive, and suppose you want to use NEWSHELL.COM as your command interpreter. To do this, add the following command to your CONFIG.NT file:
shell=\bin\newshell.com


Volgens mij lijkt dat iets anders, maar is dat ook zo?


Verder geeft:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/objectmap.asp

Scriptable Shell Objects  
The Microsoft Windows Shell provides a powerful set of automation objects that enable you to program the Shell with Microsoft Visual Basic and scripting languages such as Microsoft JScript (compatible with ECMA 262 language specification) and Visual Basic Scripting Edition (VBScript). You can use these objects to access many of the Shell's features and dialog boxes. For example, you can access the file system, launch programs, and change system settings.

This section introduces the scriptable Shell objects.

Shell Versions

Many of the Shell objects became available in version 4.71 of the Shell. Others are available in version 5.00 and later. This means that on computers running Windows 95 or Microsoft Windows NT 4.0, the Shell objects are available only if the integrated desktop is installed. Version 4.71 of the Shell is on all Windows 98 computers, and version 5.00 is on all Windows 2000 computers. The following table lists each Shell object under the version of the Shell in which the object became available.


Dit kan weleens mijn probleem zijn.

Groetjes HofCAD CSI
ACADcadabra

WebRacer

<SCRIPT LANGUAGE="JavaScript">
<!--
 function fnGetMyPathJ()
 {      
   var oShell = new ActiveXObject("Shell.Application");
            
   var oFolder = new Object;               
   oFolder = oShell.BrowseForFolder(0, "Choose a folder", 0);
                     
   var oFolderItem = new Object;      
   oFolderItem = oFolder.Items().Item();                        
   
   document.all.item("myPath").innerText = oFolderItem.Path;
 }    
-->
</SCRIPT>


Idd HofCAD, zal er alle2 wel mee te maken hebben denk ik...
shell dient in ieder geval om een applicatie aan te spreken via script,
dat kunnen we nu wel stellen...
?

FastFiber