Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 62 guests online
 
Advertisement

You are here: Home arrow Resourcesarrow Tutorialsarrow sending attachment via sendmail with from address/name, subject and message
EH-Net
May 25, 2013, 07:38:21 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: sending attachment via sendmail with from address/name, subject and message  (Read 3694 times)
0 Members and 1 Guest are viewing this topic.
buttErz
Newbie
*
Offline Offline

Posts: 1


View Profile
« on: April 17, 2012, 07:35:11 PM »

Hey guys, so I have been doing some reading and finally decided to come here because I am still having no luck... So I have found a way to send an attachment via sendmail but without adding a subject, from address/name, nor the message itself using this command:

uuencode filename | sendmail -fSender<senderemail@mail.com> cristi.tane@xnet.ro

However, as I said I would like to be able to add from, from name, etc, so I also found this bash script that does not work for me:

http://www.unix.com/faq-submission-queue/9417-multiple-attachments.html

I just closed my VM for backtrack but the ONLY error I get says that it cannot find the command grep =/ while I am able to do grep outside of the script...

Finally, I also heard of a tool called MIME-tools that has everything built into it and I managed to install that successfully - but I have no idea how to use it nor can find anything readily available on google... can someone help me please? thank you! Smiley
Logged
MaXe
Hero Member
*****
Offline Offline

Posts: 669


I've just upgraded myself to a cyborg muahahaa!!1


View Profile WWW
« Reply #1 on: April 21, 2012, 09:15:03 AM »

Don't take this personal, but I think with a bit more searching you would've found an answered. After a couple of minutes skimming through 10-20 pages with this Google Query: "sendmail" attachment

I found the following:

Quote
How about using mutt?

mutt -a attachment -s "this is the subject" user@emailaddress.com < fileWITHdetail
or
echo "this is the detail" | mutt -a attachment -s this is the subject" user@emailaddress.com < /dev/null

Usage:
-a <file> attach a file to the message
-b <address> specify a blind carbon-copy (BCC) address
-c <address> specify a carbon-copy (CC) address
-e <command> specify a command to be executed after initialization
-f <file> specify which mailbox to read
-F <file> specify an alternate muttrc file
-H <file> specify a draft file to read header from
-i <file> specify a file which Mutt should include in the reply
-m <type> specify a default mailbox type
-n causes Mutt not to read the system Muttrc
-p recall a postponed message
-R open mailbox in read-only mode
-s <subj> specify a subject (must be in quotes if it has spaces)
-v show version and compile-time definitions
-x simulate the mailx send mode
-y select a mailbox specified in your `mailboxes' list
-z exit immediately if there are no messages in the mailbox
-Z open the first folder with new message, exit immediately if none
-h this help message

Quote
You can use mailx (which uses the Sendmail executable) command:

mailx -s "Subject Line" user@somewhere < /name/of/text_file

Reference:
http://www.unix.com/solaris/23835-attachment-using-sendmail.html

Also see this: http://www.unix.com/shell-programming-scripting/118534-sendmail-attachments.html

And this: http://www.unix.com/shell-programming-scripting/58448-sendmail-attachment.html


Keep in mind that when you use premade bash scripts, make sure to edit e.g., variables that needs to be set by you.
Logged

I'm an InterN0T'er
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.063 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Free Business and Tech Magazines and eBooks

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.