Mail::SendEasy(3pm)

๐Ÿ“ฆ
version 1.2 ยท 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

โœจ Mail::SendEasy โœจ

okay bestie, sit down, hydrate, and let me tell you about Mail::SendEasy โ€” it's a Perl module from the User Contributed Perl Documentation crew, and it's literally here to send your emails for you. ๐Ÿซถ


๐Ÿ’Œ NAME

Mail::SendEasy โ€” send plain/html e-mails through SMTP servers (platform independent). Supports SMTP authentication and attachments. ๐Ÿ’…


๐ŸŒธ DESCRIPTION

So this module sends e-mails the easy way, and the way that it has no dependencies? Iconic. Fr fr, you do not need to install libnet. Not even a little bit. ๐ŸŽ€

It supports SMTP authentication and attachments. That's the whole vibe. โœจ


๐Ÿฆ‹ USAGE

๐Ÿ’– OO

use Mail::SendEasy ;

my $mail = new Mail::SendEasy(
smtp => 'localhost' ,
user => 'foo' ,
pass => 123 ,
) ;

my $status = $mail->send(
from    => 'sender@foo.com' ,
from_title => 'Foo Name' ,
reply   => 're@foo.com' ,
error   => 'error@foo.com' ,
to      => 'recp@domain.foo' ,
cc      => 'recpcopy@domain.foo' ,
subject => "MAIL Test" ,
msg     => "The Plain Msg..." ,
html    => "<b>The HTML Msg...</b>" ,
msgid   => "0101" ,
) ;

if (!$status) { print $mail->error ;}

๐ŸŒˆ STRUCTURED

use Mail::SendEasy ;

my $status = Mail::SendEasy::send(
smtp => 'localhost' ,
user => 'foo' ,
pass => 123 ,
from    => 'sender@foo.com' ,
from_title => 'Foo Name' ,
reply   => 're@foo.com' ,
error   => 'error@foo.com' ,
to      => 'recp@domain.foo' ,
cc      => 'recpcopy@domain.foo' ,
subject => "MAIL Test" ,
msg     => "The Plain Msg..." ,
html    => "<b>The HTML Msg...</b>" ,
msgid   => "0101" ,
) ;

if (!$status) { Mail::SendEasy::error ;}

๐Ÿ‘‘ METHODS

๐ŸŒŸ new (%OPTIONS)

here's your %OPTIONS menu, bestie:

  • smtp โ€” the SMTP server. (Default: localhost) ๐Ÿ–ฅ๏ธ
  • port โ€” the SMTP port. (Default: 25) ๐Ÿ”Œ
  • timeout โ€” how long it waits for the connection and data. (Default: 120) โณ
  • user โ€” the username for authentication. ๐Ÿชช
  • pass โ€” the password for authentication. ๐Ÿ”

๐ŸŒŸ send (%OPTIONS)

and here's the %OPTIONS for sending, no cap:

  • from โ€” the e-mail adress of the sender. (Only accept one adress). ๐Ÿ“ฎ
  • from_title โ€” the name or title of the sender. ๐Ÿท๏ธ
  • reply โ€” e-mail used to reply to your e-mail. โ†ฉ๏ธ
  • error โ€” e-mail to send error messages. ๐Ÿšจ
  • to โ€” recipient e-mail adresses. ๐Ÿ“ฌ
  • cc โ€” adresses to receive a copy. ๐Ÿ“‹
  • subject โ€” the subject of your e-mail. โœ๏ธ
  • msg โ€” the plain message. ๐Ÿ“
  • html โ€” the HTML message. If used with MSG (plain), the format "multipart/alternative" will be used. Readers that can read HTML messages will use the HTML argument, and readers with only plain messages will use MSG. ๐Ÿ’ป
  • msgid โ€” an ID to insert in the e-mail Headers. The header will be: Msg-ID: xxxxx ๐Ÿ†”
  • anex โ€” send file(s) attached. Just put the right path in the machine for the file. For more than one file use ARRAY ref: ['file1','file2'] ๐Ÿ“Ž
** Will load all the files in the memory.
  • zipanex โ€” compress with zip the ANEX (attached) file(s). All the files will be inside the same zip file. ๐Ÿ—œ๏ธ

If the argument has the extension .zip, will be used for the name of the zip file. If not, the file will be "anex.zip", and if exist only one ANEX, the name will be the same of the ANEX, but with the extension .zip.

** Need the module Archive::Zip installed or the argument will be skipped.
** This will generate the zip file in the memory.

๐Ÿงš SEE ALSO

Mail::SendEasy::SMTP, Mail::SendEasy::AUTH, HPL.

This module was created to handle the e-mail system of HPL. ๐Ÿ’œ


๐Ÿ’€ AUTHOR

Graciliano M. P. <gm@virtuasites.com.br>

I will appreciate any type of feedback (include your opinions and/or suggestions). ;-P ๐Ÿ™ˆ


This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


okay that's the whole page, bestie!! this lil gem is from perl v5.32.0, dated 2021-01-05, and it's living its best life as Mail::SendEasy(3pm) in the User Contributed Perl Documentation collection. go send some emails, you got this ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹๐ŸŒธ๐Ÿ’…๐Ÿซถ๐Ÿ˜ญ๐Ÿ”ฅ๐Ÿ‘‘๐ŸŒˆโญ๐Ÿ’€๐Ÿ™ˆ๐Ÿ“๐Ÿงš๐Ÿ’œ

๐Ÿ“ฆ where this page comes from