neutralstone has asked for the wisdom of the Perl Monks concerning the following question:

I've got a perl mail client that already works, except it can't send mail where the mail server requires AUTH LOGIN. I'm pretty sure I should use Net::Cmd, but I'm not too sure about anything else. Net::SMTP doesn't seem to offer a way to do this (but I don't know much perl yet, so I could be wrong). (New to Perl, BTW.)
  • Comment on Sending EHLO extension commands to an SMTP server?

Replies are listed 'Best First'.
RE: Sending EHLO extension commands to an SMTP server?
by Zarathustra (Beadle) on Oct 01, 2000 at 00:18 UTC
    Hmm, I just use IO::Socket --
    use IO::Socket; # .... ## open socket to smtp server # syslog('debug', "Opening smtp socket"); $smtp = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "${mailhost}:25") or do { ## bad news $mailhostDown = 1; syslog('crit', "Mail server down!", $!); exception('crit', "Unable to open socket to $mailhost!", $!); }; ## write to socket, sending email # <$smtp> and print $smtp "EHLO $hostname\r\n"; <$smtp> and print $smtp "MAIL FROM: <$fromAddr>\r\n"; for ( @{ $recipients } ) { next unless $_; <$smtp> and print $smtp "RCPT TO: $_\r\n"; } <$smtp> and print $smtp "DATA\r\n"; <$smtp> and print $smtp "From: $fromName <$fromAddr>\r\n"; print $smtp "To: $to\r\n"; print $smtp "Subject: $msg_subject\r\n"; print $smtp "@{$msg}\r\n"; print $smtp "\r\n.\r\n"; <$smtp> and print $smtp "QUIT\r\n"; <$smtp> and $smtp->close;
    I'm certain you could send your: AUTH CRAM-MD5 or DIGEST-MD5 or whatever just as easily.
Re: Sending EHLO extension commands to an SMTP server?
by BastardOperator (Monk) on Sep 30, 2000 at 08:28 UTC