Perl The following code builds a MIME mail message demonstrating all the portions of the SMTP API protocol. To use this example, you will need to have the following perl modules installed: MIME::Entity Authen::SASL Copy #!/usr/bin/perl use strict; use MIME::Entity; use Net::SMTP; # from is your email address # to is who you are sending your email to # subject will be the subject line of your email my $from = ‘email@example.com’; my $to = ‘firstname.lastname@example.org’; my $subject = ‘Example Perl Email’; # Create the MIME message that will be sent. Check out MIME::Entity on CPAN for more details my $mime = MIME::Entity->build(Type => ‘multipart/alternative’, Encoding => ‘-SUGGEST’, From => $from, To => $to, Subject => $subject ); # Create the body of the message (a plain-text and an HTML version). # text is your plain-text email # html is your html version of the email # if the reciever is able to view html emails then only the html # email will be displayed my $text = “Hi!\nHow are you?\n”; my $html = < Hi! How are you?