BeagleBone Black Wireless and Perl with Emails…

Have you ever wanted to set up an HTML email via Perl on the BBB w/ some gmail and to whomever you would like to send an email in mind?

Categories: Beginner

Hello,

This project is about setting up a simple email in Perl on the BBBW (BeagleBone Black Wireless).

Okay. So, shall we get to it? Okay. Here we go!

Get an image from
https://beagleboard.org/latest-images
and set up your board by using Etcher and 7-Zip.

If you are unfamiliar w/ setting up a new Distro on your BBB family boards from BeagleBoard.org, see here:
https://beagleboard.org/getting-started.

Now, onto using what is already built into the Debian image we are going to use (after you set up your board w/ the latest image from their site).

Here is the software:

#!/usr/bin/perl

use MIME::Lite;

$to = 'your friend's email address';

$from = 'your email address';

$subject = 'Test Email';

$message = '<h1>This is test. This is only a test.</h1>';

$msg = MIME::Lite->new(

                From     => $from,

                To       => $to,

                Cc       => $cc,

                Subject  => $subject,

                Data     => $message

                );

$msg->attr("content-type" => "text/html");

$msg->send('smtp', "Here is where you need to type smtp.<your ISP's Provider address>", AuthUser=>"your email address", AuthPass=>"email password");

print "Email Sent Successfully\n";


Now…where the "$msg->send is located above in the src code, look around and if you have Comcast or Cox or Google or whatever, use the
smtp.cox.net
for instance for the second string in that row. If this does not make sense, please ask questions.

We need to set up MIMI::Lite. To do this go to
https://www.tutorialspoint.com/perl/perl_sending_email.htm.
While on that site, scroll down to where it states:

Using MIME::Lite Module <——-

At this heading on their site, use the following commands to set up this library on your BBB. If you have a Windows set up for development desktop, use WinSCP to transfer the file, the.tar.gz file on that site, to your BBBW or other
beagleboard.org
family of boards for processing.

Okay. Once we have the MIMI::Lite module installed and transferred, we need to apply some basic reasoning and application usage.

So, go to your file maker, your favorite editor, and type for instance:

nano email.pl


Once we get into that text editor, like w/ nano, type the above email creating text in the src code.

To run the email program we just created, use perl email.pl. That should do it. If you have any issues running this software w/ the updated kernel and an image from the
BBB.io
peoples, let me know. I would like to know.

Seth

P.S. So, copy the source, add your credentials, and then run the software example. It will show you a message at the end signifying that your email has been sent.

Comments are not currently available for this post.