Using Email::Send::SMTP with authentication

Discussion in 'Perl Misc' started by Bob, Apr 18, 2006.

  1. Bob

    Bob Guest

    Hello, all...

    I am trying to send email messages via a remote SMTP server using the
    Email::Send::SMTP module. It's _almost_ (I think) working, but I can't
    get past the authentication. The error message is "Couldn't
    authenticate 'myaccount:...' at emailtest.pl line 27" (the line with
    the call to send()). Probably a dumb mistake on my part. Can anyone
    offer guidance? My test code is below.

    Thanks!

    Bob

    #!/usr/bin/perl

    use strict;

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

    my $msg = Email::Send->new({mailer => 'SMTP'});
    $msg->mailer_args([
    header => [
    To => '',
    Subject => 'email test',
    From => ''],
    attributes => {'content_type' => 'text/html'},
    body => 'This is a test']);

    my $retval = Email::Send::SMTP->send(
    $msg,
    Host => 'smtp.mydomain.com',
    username => 'myaccount',
    password => 'mypassword');

    die "$retval" if ! $retval;
    Bob, Apr 18, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Jones

    Cannot send email using SMTP

    Bob Jones, Aug 7, 2003, in forum: ASP .Net
    Replies:
    9
    Views:
    3,946
    Bob Jones
    Aug 8, 2003
  2. Rodrigo
    Replies:
    1
    Views:
    686
    Marina
    Aug 28, 2003
  3. networm
    Replies:
    3
    Views:
    18,308
  4. networm
    Replies:
    2
    Views:
    115
    Thomas Kratz
    Aug 12, 2004
  5. ashish makani
    Replies:
    5
    Views:
    555
    Mark Lawrence
    Sep 20, 2012
Loading...

Share This Page