Sending Email in Cadence

Discussion in 'Cadence' started by chickenwing2010, Aug 14, 2006.

  1. Hi friends,

    Is there any SKILL function which can send emails to specific email
    addresses?? For example, any functions like SendEmail(
    "," "message_hello" ) or something like
    this??

    Any comment is highly appreciated ~

    Will
     
    chickenwing2010, Aug 14, 2006
    #1
  2. chickenwing2010

    Jimka Guest

    hi Will, if you can figure out how to send an email from the shell,
    then you can send it from SKILL with the SKILL function called
    system.

    The problem is that it is pretty difficult to come up with a shell
    script
    that will send email on any UNIX system because of the different
    command lines available for the mail program and the fact that some
    system administrators disable the UNIX mail program to try to force
    you to use microsoft outlook or something like that.

    But assume you have a shell script that works like the following.

    my_mail -subject "the subject line" -to <<EOF
    this is the mail body
    many lines of
    mail happily going to the correct
    destination.
    EOF

    then you can write a SKILL function like the following.

    (defun send_email (@key (subject "default subject") (to "nobody") (body
    '("default body") "ttl"))
    (let ((tmpfile (outfile "/tmp/mailfile"))) ;; better would to make
    a uniq filename
    (foreach line body (fprintf "%s\n" line))
    (close tmpfile))
    (system (sprintf nil "cat /tmp/mailfile | my_mail -subject %L -to
    %L" subject to ))
    (deleteFile "/tmp/mailfile"))

    It would be better to create a tmp file name that is unique, but i
    always forget the name of the makeTmpFileName function.

    And again, the trick is to write the shell script my_mail so that it
    works on your UNIX system and anywhere on your network where someone
    might want to run your SKILL function.

    -jim
     
    Jimka, Aug 14, 2006
    #2
  3. Pretty close - it's makeTempFileName()

    Andrew.
     
    Andrew Beckett, Aug 16, 2006
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.