EEM Script for email attachment.

Unanswered Question
Mar 1st, 2010

I have a scenario where there is a log file named "test.log" on my sup-bootdisk0:. I need to send that log file as an "attachment" to NOC using EEM script. I have a script that can send the plain email as follows.

#----------------------- send e-mail to NOC ----------------------

  set body [format "Mailservername: %s" "$_email_server"]
  set body [format "%s\nFrom: %s" "$body" "$_email_from"]
  set body [format "%s\nTo: %s" "$body" "$_email_to"]
  set body [format "%s\nSubject: %s\n" "$body" "Email from Router $_router_name"]
  set body [format "%s\n%s" "$body" "$show_log"]

  if [catch {smtp_send_email $body} result] {
    action_syslog msg "smtp_send_email: $result"
  }
  action_syslog msg "E-mail sent to $_email_to with attachment."

Can somebody let me know what needs to be added to above script so that it can send the "test.log" file as an email attachment?

Thank you in advance.

D

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Joe Clarke Mon, 03/01/2010 - 14:10

When you say, "attachment," do you mean MIME attachment, or do you just want the contents of the file sent in the body of the email?  What version of code are you running?

dmalla Mon, 03/01/2010 - 14:31

Joe,

It's a MIME attachment. We are using "c7600rsp72043-advipservicesk9-mz.122-33.SRC4.bin"

-D

Joe Clarke Tue, 03/02/2010 - 09:15

This should work for you, but I do not have an SRC4 box with which to test.

Joe Clarke Wed, 03/24/2010 - 09:25

Looks like the forum stripped my attachment.  I have attached it again.

Joe Clarke Wed, 03/24/2010 - 10:19

Yeah, something seems broken.  This is now the second time it got stripped.  Let me try it with a different name.

Joe Clarke Wed, 03/31/2010 - 15:17

I'll try and post one more time.  I reported this problem to the forum IT staff, but I haven't heard anything back from them.

Actions

This Discussion