develooper Front page | perl.perl6.users | Postings from July 2017

Net::SMTP raw, where is the username and password?

Thread Next
From:
ToddAndMargo
Date:
July 10, 2017 05:56
Subject:
Net::SMTP raw, where is the username and password?
Message ID:
0b770329-7d8c-b000-ed20-4bd8435aa834@zoho.com
Hi All,

From: https://github.com/retupmoca/P6-Net-SMTP

# raw interface
my $client = Net::SMTP.new(:server("your.server.here"), :port(587), 
:debug, :raw);
$client.get-response; # 220 your.server.here ...
$client.ehlo; # 250-STARTTLS\r\n250 ...
$client.mail-from('from@your.server.here'); # 250 OK
$client.rcpt-to('to@your.server.here'); # 250 OK
$client.data; # 354 Enter message
$client.payload($email); # 250 OK
$client.quit; # 221 closing connection

Where do I put the user name and password for the SMTP server?

It is either
     auth-login($username, $password)     or
     auth-plain($username, $password)

But where does it go?  After the $client.ehlo ??

Many thanks,
-T

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About