in reply to SMTP authorisation for MIME emails.

Net::SMTP implements Auth, but needs Authen::SASL See methods and samples on pod or code:

... cut ... sub auth { my ($self, $username, $password) = @_; eval { require MIME::Base64; require Authen::SASL; } or $self->set_status(500,["Need MIME::Base64 and Authen::SASL to +do auth"]), return 0; ... cut ...

Humm, good! Implements a convenient, test to prevent error... (can be optimized, but it's good!)

I'm using this to send my test messages on authenticaded. .............

--
Marco Antonio
Rio-PM

Replies are listed 'Best First'.
Re^2: SMTP authorisation for MIME emails.
by jdtoronto (Prior) on Aug 22, 2006 at 16:42 UTC
    Thanks mda2,

    I had seen a reference to the auth method in the POD, but when I tried it I had no luck. Seems I didn't read far enough ;)

    After looking at the source for Mail::Internet it seems the Net::SMTP object is well buried and only exists briefly within the scope of the smtpsend method. The author was very prompt in replying and I find myself agreeing with his assetion that their are better ways and this one is no longer something he is prepared to enhance. That being said I think the more appropriate approach would be to use MIME::Entity (to which I am committed) or maybe MIME::Lite to produce the MIME body and then send it explicitly using Net::SMTP.

    jdtoronto