Find the answer to your Linux question:
Results 1 to 3 of 3
I have a mail script that is working, and will be modified but need to have it attach a file or the text from the file. This is my test ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Nov 2004
    Location
    Glacier, WA
    Posts
    103

    Sending Attachments


    I have a mail script that is working, and will be modified but need to have it attach a file or the text from the file.

    This is my test script
    <html>
    <body>
    <?php
    // The message
    $message = "Line 1\nLine 2\nLine 3";

    // In case any of our lines are larger than 70 characters, we should use wordwrap()
    $message = wordwrap($message, 70);

    // Send
    mail('bill@xxxxxxxxx.com', 'My Subject', $message);
    ?>
    </body>
    </html>

  2. #2
    Banned CodeRoot's Avatar
    Join Date
    Sep 2005
    Posts
    567
    Google yielded this:

    http://www.sitepoint.com/print/advanced-email-php

    and a lot more...

  3. #3
    Linux User muha's Avatar
    Join Date
    Jan 2006
    Posts
    290
    maybe i'm barking up the wrong tree here ..
    Code:
    mail -s "Hello world from for `hostname`" sysadm@something.com < ~/<file_to_include>
    Send an email. -s specifies the subject. sysadm@something.com is to to-address. Include a file in the email with <
    Start typing away after the mail command and when you are done finish with a single dot (.) on a blank line to finish the message body.
    You can also send email to users on your system: mail -s "test" <someusername>
    Now what? You have Linux installed and running. The GUI is working fine, but you are getting tired of changing your desktop themes. You keep seeing this "terminal" thing. Don't worry, they'll show you what to do @
    <~ http://www.linuxcommand.org/ ~>

Posting Permissions

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