The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Email::Send::SMTP::Gmail - Sends emails with attachments supporting Auth over TLS or SSL (for example: Google's SMTP)

SYNOPSIS

   use strict;
   use warnings;

   use Email::Send::SMTP::Gmail;

   my $mail=Email::Send::SMTP::Gmail->new( -smtp=>'gmail.com',
                                           -login=>'whateveraddress@gmail.com',
                                           -pass=>'whatever_pass');

   $mail->send(-to=>'target@xxx.com',
               -subject=>'Hello!',
               -charset=>'KOI8-R'
               -verbose=>'1',
               -body=>'Just testing it',
               -contenttype => 'text/plain',
               -attachments=>'full_path_to_file');

   $mail->bye;

DESCRIPTION

Simple module to send emails through Google's SMTP with or without attachments. Works with regular Gmail accounts as with Google Apps (your own domains). It supports basic functions such as CC, BCC, ReplyTo.

new(-login=>'', -pass=>'' [,-smtp=>'',layer=>'',-port=>'',-debug=>''])

It creates the object and opens a session with the SMTP.

smtp: defines SMTP server. Default value: smtp.gmail.com layer: defines the secure layer to use. It could be 'tls'or 'ssl'. Default value: tls port: defines the port to use. Default values are 25 for tls and 465 for ssl debug: only really works with ssl layer (because currently Net::SMTP::TLS::ButMaintained doesn't support it).

send(-to=>'', [-subject=>'', -cc=>'', -bcc=>'', -replyto=>'', -charset=>'', -body=>'', -attachments=>''])

It composes and sends the email in one shot

to, cc, bcc: comma separated email addresses
contenttype: Content-Type for the body message. Examples are: text/plain (default), text/html, etc.
attachments: comma separated files with full path
bye

Closes the SMTP session

BUGS

Please report any bugs or feature requests to bug-email-send-smtp-gmail at rt.cpan.org or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Email-Send-SMTP-Gmail. You will automatically be notified of the progress on your bug as we make the changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Email::Send::SMTP::Gmail

You can also look for information at:

AUTHORS

Martin Vukovic, <mvukovic at microbotica.es>

Juan Jose 'Peco' San Martin, <peco at cpan.org>

COPYRIGHT

Copyright 2012 Microbotica

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

6 POD Errors

The following errors were encountered while parsing the POD:

Around line 285:

Unknown directive: =over2

Around line 287:

'=item' outside of any '=over'

Around line 291:

Unknown directive: =over6

Around line 300:

'=item' outside of any '=over'

Around line 304:

Unknown directive: =over6

Around line 314:

'=item' outside of any '=over'