Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I would like to know how to send a mail from Linux via sendmail command option with attachment of a file. Please share me the steps if anyone aware ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    11

    Post sending attachment by sendmail command


    Hi,

    I would like to know how to send a mail from Linux via sendmail command option with attachment of a file. Please share me the steps if anyone aware of it.

    Thanks in advance.

    Regards,
    Sachikanta

  2. #2
    Just Joined!
    Join Date
    Mar 2012
    Posts
    15
    you can add the contents of the file to the email with $(cat filename)

  3. #3
    Just Joined!
    Join Date
    Aug 2011
    Posts
    11
    Thanks for your help.. In fact i am using mutt command currently, but i wanted to use sendmail because i would like to get html format mail from linux command line.

    cat file_name.txt | sendmail mail_id

    from the above file_name.txt file contains html code and by sendmail command i can get html format output to my inbox and i wanted to get one more html file by attachment in the same mail.

    currently I am using the below command to get attachment by mail to my inbox.

    mutt -s 'SUBJECT' -a "file_name.html" mail_id < message.txt

    the above command is sending the attachment in mail but mail content is plain text format. so I would like to receive the mail content in html format with attachment of a file.

    Please advise.

    Regards,
    Sachikanta

  4. $spacer_open
    $spacer_close

Posting Permissions

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