Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: flavigny on October 26, 2012, 07:34:17 AM

Title: [modified, smarter: ] How I send email from my OlinuxInoMaxi
Post by: flavigny 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



Title: Re: [modified, smarter: ] How I send email from my OlinuxInoMaxi
Post by: LubOlimex 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
Title: Re: [modified, smarter: ] How I send email from my OlinuxInoMaxi
Post by: bsrdjan on December 16, 2012, 11:35:29 AM
I use Gmail and Python http://kutuma.blogspot.de/2007/08/sending-emails-via-gmail-with-python.html