Author Topic: Syntax for email  (Read 11071 times)

0 Members and 1 Guest are viewing this topic.

Patrick_35

  • Guest
Re: Syntax for email
« Reply #15 on: January 28, 2007, 03:10:48 PM »
I send me this message and it's ok

Code: [Select]
(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 "smtp.aliceadsl.fr");"ServeurSMTP"
(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       "patrick35@tiscali.fr");"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 d'envoyer le message. Pas de connection internet")
)

(vlax-Release-Object Outlk)

Adesu

  • Guest
Re: Syntax for email
« Reply #16 on: January 28, 2007, 11:30:34 PM »
Hi Patrick,
I got it,your code is great,thanks you very much

Adesu

  • Guest
Re: Syntax for email
« Reply #17 on: January 29, 2007, 02:46:20 AM »
Hi Patrick,
Here picture email or look at attach file,and this code ,then not forgot ,thanks you very much for your help
Code: [Select]
(defun c:test (/ outlk serv)
  (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 "smtp.cbn.net.id")
  (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     "mteybid@yuasabattery.co.id")
  (vlax-Put-Property Outlk 'To       "mteybid@yuasabattery.co.id")
  (vlax-Put-Property Outlk 'Subject  "Test send email via Autolisp")
  (vlax-Put-Property Outlk 'TextBody "Hi Adesu, Here I just tested email,please feed back again to me,I wait it")
  (if
    (vl-catch-all-error-p (vl-catch-all-apply 'vlax-invoke (list outlk 'Send)))
    (princ "\nImpossible d'envoyer le message. Pas de connection internet")
    )
  (vlax-Release-Object Outlk)
  (princ)
  )
« Last Edit: January 29, 2007, 02:49:54 AM by Adesu »

Patrick_35

  • Guest
Re: Syntax for email
« Reply #18 on: January 29, 2007, 03:11:06 PM »
Hi Adesu
For attach a file, you do
Code: [Select]
(vlax-invoke outlk 'AddAttachment  "My_file.any_extension")before send your message

@+

Maverick®

  • Seagull
  • Posts: 14778
Re: Syntax for email
« Reply #19 on: January 29, 2007, 03:54:02 PM »
Adesu,  You may want to block out your email address in that image.  Just not something I would recommend posting.

Regards,

Maverick

CADwiesel

  • Newt
  • Posts: 46
  • Wir machen das Mögliche unmöglich
Re: Syntax for email
« Reply #20 on: March 06, 2007, 03:38:00 AM »
I have following sendmail code:
Code: [Select]
(defun M:SENDMAIL (an Betreff Inhalt / MAIL OLOBJ)
  (vl-load-com)
  (setq OLOBJ (vlax-Get-Or-Create-Object "Outlook.Application")
        MAIL  (vlax-invoke-method OLOBJ "CreateItem" 0)
        ) ;_ ende von setq
  (vlax-invoke-method
    (vlax-get-property
      MAIL
      'recipients
      )
    'add
    an
    )
  (vlax-put-property MAIL 'subject betreff)
  (vlax-put-property MAIL 'body Inhalt)
  (vlax-invoke-method MAIL 'send)
  (vlax-release-object OLOBJ)
  (prin1)
  )

(M:SENDMAIL "cadwiesel@cadwiesel.de"
        "testmail";Betr
        (strcat "Sehr geehrter Herr Blahblah..\n\n"
                "<A href="(chr 34)
                "C:\\TEMP\\test.xls>"
                (chr 34)
                "klick hier"
                "</A>"
                "\n\n\n mit freundlichem Gruß\n\n CADwiesel")
        )

The question i have is:
How is it possible to create an link in the Body tag of the document.
I want to send the text  "C:\\TEMP\\test.xls>" shown as url.
Do anyone knows how this works?

Thanks
CADwiesel
Gruß
CADwiesel
Besucht uns im CHAT