Welcome, Guest

Author Topic: [modified, smarter: ] How I send email from my OlinuxInoMaxi  (Read 3750 times)

flavigny

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
[modified, smarter: ] How I send email from my OlinuxInoMaxi
« on: October 26, 2012, 07:34:17 AM »
Hello,
this post is for newbies on small linux, I apologize if it is not welcomed on this forum. Could moderator confirm?

I observed that my distro (yocto enriched by otavio) doesn't contain easy tool for exporting file (ftp, mpack, ...)
Last week, I wrote a fist draft (see below), now (added 20121028) a lighter one, without intermediate file. Type script in file: 'sendfi'
#!/bin/sh
echo -e "HELO your-machine\rMAIL FROM: <your-email>\rRCPT TO: <$1>\rDATA\rSUBJECT: file: $2\r\r`cat $2`\r.\r"|nc your-smtp-server 25

then, chmod +x sendfi
for sending a file, use:
./sendfi email-address  filename

Goodies: even without script, paste the next line:
echo -e "HELO your-machine\rMAIL FROM: <your-email>\rRCPT TO: <dest-email>\rDATA\rSUBJECT: file: file-name\r\r`cat file-name`\r.\r"|nc your-smtp-server 25

Of course, you have to fix the underlined-names!
Regards
PO.
------------------------------------ %X
for information, obsolete version:
so, I wrote a script 'sendfi':
#!/bin/sh
# send file to email
rm sendfi.txt
echo >> sendfi.txt HELO your-machine
echo >> sendfi.txt MAIL FROM: \<your-email\>
echo >> sendfi.txt RCPT TO: \<$1\>
echo >> sendfi.txt DATA
echo >> sendfi.txt SUBJECT: file: $2
echo >> sendfi.txt
cat >> sendfi.txt $2
echo>>sendfi.txt .
nc your-smtp-server 25 < sendfi.txt



« Last Edit: October 28, 2012, 02:28:37 PM by flavigny »

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1753
  • Karma: +46/-2
Re: [modified, smarter: ] How I send email from my OlinuxInoMaxi
« Reply #1 on: October 29, 2012, 10:57:04 AM »
Hey flavigny,

It is more than welcome to explain basics in the forums. I bet somebody would find it useful even if not an Olimex customer.

If you wish to contribute with useful advices and findings you might consider submitting in the wiki. You can apply for account e-mailing here: info@olimex.com.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

bsrdjan

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
« Last Edit: December 16, 2012, 11:37:05 AM by bsrdjan »