#!/usr/bin/perl -w use MIME::Base64; use Net::SMTP::SSL; my($User,$Password) = ('my_email@gmail.com', 'password'); $EncodedLogin = encode_base64("\00".$User."\0".$Password); my $smtp = Net::SMTP::SSL->new('smtp.gmail.com',Port=>465,Debug=>1,Hello=>'mx.google.com'); $smtp->datasend("AUTH PLAIN " . $EncodedLogin); $smtp->dataend();