0 Members and 1 Guest are viewing this topic.
(setq wsh (vlax-create-object "WScript.Shell"))(setq app (vlax-invoke wsh 'exec "C:\\Program Files\\Outlook Express\\msimn.exe"))
(vlax-invoke app 'terminate)
(setq outlk (vlax-create-object "CDO.Message")) ; Link for windows XP(vlax-put-property outlk 'From "My_email@server.com") ; Shipper(vlax-put-property outlk 'To "Recipient@server.com") ; Recipient(vlax-put-property outlk 'Subject "Subject") ; Subject(vlax-put-property outlk 'TextBody "My Message") ; Message(vlax-invoke outlk 'Send) ; Send message(vlax-release-object outlk) ; Release object
(vlax-put-property outlk 'AddAttachment "c:/rep1/rep2/My_Attach.txt") ; for link a piece(vlax-put-property outlk 'HTMLBody "<br><img src='image.jpg'><br>") : for link an image
First question, am I supposed to get a nil at the vlax-put-property(s) ?
(vlax-put-property mail_object 'CreateMHTMLBody "file://c:/test.htm")or a (vlax-invoke-method mail_object 'CreateMHTMLBody "file://c:/test.htm")
(vlax-invoke-method mail_object 'CreateMHTMLBody "file://c:/test.htm")
(setq Outlk (vlax-Create-Object "CDO.Message"))(setq Serv (vlax-Get-Property (vlax-Get-Property Outlk 'Configuration) 'Fields))(vlax-Put-Property (vlax-Get-Property Serv 'Item "http://schemas.microsoft.com/cdo/configuration/sendusing") 'Value 2)(vlax-Put-Property (vlax-Get-Property Serv 'Item "http://schemas.microsoft.com/cdo/configuration/smtpserver") 'Value "ServerSMTP") ; ex: smpt.aol.com(vlax-Put-Property (vlax-Get-Property Serv 'Item "http://schemas.microsoft.com/cdo/configuration/smtpserverport") 'Value 25)(vlax-Invoke Serv 'Update)(vlax-Put-Property Outlk 'From "My_email@server.com")(vlax-Put-Property Outlk 'To "Recipient@server.com")(vlax-Put-Property Outlk 'Subject "Subject")(vlax-Put-Property Outlk 'TextBody "My Message")(if (vl-catch-all-error-p (vl-catch-all-apply 'vlax-invoke (list outlk 'Send))) (princ "\nImpossible to send the message. No connection Internet"))(vlax-Release-Object Outlk)