Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default email script

    Hi,

    I have been using the below script to attach text files to a email and send
    the email to whoever. But, I'd like to change the file Type to attach a
    Excel file instead of a text file. What type of changes would I need to
    make?

    Thanks,
    Shawn

    #!/usr/local/bin/perl5.6

    use lib "lib";
    use MIME::Lite;

    $msg = new MIME::Lite
    From => "$ARGV[0]",
    To => "$ARGV[1]",
    Subject => "$ARGV[2]",
    Type => 'TEXT',
    Path => "$ARGV[3]",
    Encoding => '7bit';
    attach $msg
    Type => 'TEXT',
    Path => "$ARGV[4]",
    Filename => "$ARGV[5]";
    $msg->send;

    --


    Shawn Guest

  2. Similar Questions and Discussions

    1. Script to delete email from an account
      I went searching for a script that will delete emails in one of my user accounts. I found the script below. I set it up as a crons job, which...
    2. Multiple recipients possible in eMail script?
      Hi Is it possible to have multiples recipients receive the results of a form? I don't mean BCC. I want the user to be able to select from a...
    3. Email Script.
      "Walt Watzinger" <walter@crescominc.net> writes: -snip- Im not sure what you mean, can lay out some more details? loulou
    4. email confirmation script
      Hi, I'm trying to find a script that does the following: 1. A user is presented with a form with a textbox for their e-mail address. 2. The user...
    5. Form to Email Script Help!
      I am requesting values from a form including a multiple select menu then sending the values via email using the mail() function. $body =...
  3. #2

    Default Re: email script

    Shawn wrote:

    ....
    > I have been using the below script to attach text files to a email and send
    > the email to whoever. But, I'd like to change the file Type to attach a
    > Excel file instead of a text file. What type of changes would I need to
    > make?
    ....
    > Shawn
    >
    > #!/usr/local/bin/perl5.6
    >
    > use lib "lib";
    > use MIME::Lite;
    >
    > $msg = new MIME::Lite
    > From => "$ARGV[0]",
    > To => "$ARGV[1]",
    > Subject => "$ARGV[2]",
    > Type => 'TEXT',
    > Path => "$ARGV[3]",
    > Encoding => '7bit';
    > attach $msg
    > Type => 'TEXT',
    > Path => "$ARGV[4]",
    > Filename => "$ARGV[5]";
    > $msg->send;

    Try [untested]:

    ...
    attach $msg
    Type => 'application/msexcel',
    Disposition=>'attachment',
    Path => "$ARGV[4]",
    Filename => "$ARGV[5]";
    ...

    --
    Bob Walton

    Bob Walton Guest

  4. #3

    Default email script

    I like how you can link FileMaker to your email program--clicking on
    the email address will take you to, for example, outlook and address a
    blank email.

    But is there any way to turn off the feature that will lock Outlook
    and FileMaker until you save or send the email? It seems like the
    script is still running and it won't end (and take you back to
    filemaker) until one of these is done.

    Thanks

    David Averbach
    UC Berkeley
    David Averbach Guest

  5. #4

    Default Re: email script

    You may be better served with the following plugin:

    [url]https://www.productive.cc/pci_cart/FMPro?-DB=PCSC_Products.FP5&-Format=catalog.htm&-Lay=CGI&ID_No=40&-Find[/url]


    "David Averbach" <davidaverbach@earthlink.net> wrote in message
    news:a76dec2d.0309300940.5986fe33@posting.google.c om...
    > I like how you can link FileMaker to your email program--clicking on
    > the email address will take you to, for example, outlook and address a
    > blank email.
    >
    > But is there any way to turn off the feature that will lock Outlook
    > and FileMaker until you save or send the email? It seems like the
    > script is still running and it won't end (and take you back to
    > filemaker) until one of these is done.
    >
    > Thanks
    >
    > David Averbach
    > UC Berkeley

    Alan Lawrance Guest

  6. #5

    Default Re: email script

    I found this problem annoying too. Being locked in the view.
    But i was pointed in a very easy to achieve direction.

    Instead of using Send Mail script step, use Open URL instead and use
    OpenURL[mailto:email_address_field@anywhere.net]

    Just create a calculation field in your database that looks like this:
    "mailto: " & THE_NAME_OF_YOUR_EMAIL_ADDRESS_FIELD
    Then point the openURL script to that field value.

    Works a treat because as far as FileMaker is concerned, Internet Expolorer's
    dealt with the url request and all is fine. Little does it know it craftily
    opens your message in your default email program.
    You can add a bit more to this too, by adding ?subject=SUBJECT_NAME to after
    the mailto:email@anywhere.net you can specify the subject of the message.
    So mailto:email@anywhere.net?subject=SUBJECT_OF_MESSA GE

    I think I've seen websites with BCC and CC done as well as the subject, but
    I'm not sure.
    And this ?=subject business only works with Outlook Express or Outlook as
    far as I'm aware.

    I've never had reason to test it to be honest.

    HTH

    I think it's a genius solution, just wish I thought of it myself!

    Ben Bradley.



    "Alan Lawrance" <ajlawrance@home.com> wrote in message
    news:ZEkeb.52512$TM4.35738@pd7tw2no...
    > You may be better served with the following plugin:
    >
    >
    [url]https://www.productive.cc/pci_cart/FMPro?-DB=PCSC_Products.FP5&-Format=catalog.htm&-Lay=CGI&ID_No=40&-Find[/url]
    >
    >
    > "David Averbach" <davidaverbach@earthlink.net> wrote in message
    > news:a76dec2d.0309300940.5986fe33@posting.google.c om...
    > > I like how you can link FileMaker to your email program--clicking on
    > > the email address will take you to, for example, outlook and address a
    > > blank email.
    > >
    > > But is there any way to turn off the feature that will lock Outlook
    > > and FileMaker until you save or send the email? It seems like the
    > > script is still running and it won't end (and take you back to
    > > filemaker) until one of these is done.
    > >
    > > Thanks
    > >
    > > David Averbach
    > > UC Berkeley
    >
    >

    Ben Bradley Guest

  7. #6

    Default Re: email script

    One thing to watch out for with the open URL is that FMP will only accept
    something like 453 characters in the URL itself. This is problematic if you
    need to send long emails.


    Mariano Peterson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139