create new tag
, view all tags

Feature Proposal: Fix SMTP Auth


Net::SMTP auth does not work as documented. Below is a hack to get you started fixing it. You must include MIME::Base64

Description and Documentation


$smtp->datasend("AUTH LOGIN\n")|| die $mess.$smtp->message;
$smtp->response()|| die $mess.$smtp->message;
my $emaillogin = ($TWiki::cfg{SMTP}{Username});
$smtp->datasend(encode_base64($emaillogin))|| die $mess.$smtp->message.$emaillogin;
$smtp->response() || die $mess.$smtp->message;
my $passwd = ($TWiki::cfg{SMTP}{Password});
$smtp->datasend(encode_base64($passwd))|| die $mess.$smtp->message.$passwd;
# $smtp->response()|| die $mess.$smtp->message;
#set email from @to has two elements, the first being the fully qualified email address
$smtp->mail('THE SAME NAME YOU ARE USING TO LOGIN@Yourdomain.com'); # Don't \@ anywhere, it doesn't work as expected.
my $toemail = @to[0];
$smtp->to($toemail) || die $mess.$smtp->message;
$smtp->datasend("From: Use<YOURLOGIN"."@"."Yourdomain.com>\n"); #the @ symbol gets treated wrong if I try to do it another way
$smtp->datasend("To: ".$toemail."\n");
$smtp->datasend("Content-Type: text/html \n");
$smtp->datasend("Subject: Wiki from your domain");
$smtp->datasend( $text ) || die $mess.$smtp->message;


WhatDoesItAffect: API, Documentation, Vars


-- Contributors: AsphaltJesus - 16 Jan 2008


Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2008-01-17 - KwangErnLiew
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.