Skip to content

Commit

Permalink
Added Net::SMTP support as per Peter's patch (Apr 29, 2005).
Browse files Browse the repository at this point in the history
	Seems this patch never made it to CVS.
  • Loading branch information
Ton Verhagen committed Feb 1, 2007
1 parent 2717bcf commit d821564
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions code/UserTag/email_raw.tag
@@ -1,11 +1,11 @@
# Copyright 2002-2005 Interchange Development Group (http://www.icdevgroup.org/)
# Licensed under the GNU GPL v2. See file LICENSE for details.
# $Id: email_raw.tag,v 1.6 2005-11-03 05:16:55 jon Exp $
# $Id: email_raw.tag,v 1.7 2007-02-01 08:21:50 ton Exp $

UserTag email-raw hasEndTag
UserTag email-raw addAttr
UserTag email-raw Interpolate
UserTag email-raw Version $Revision: 1.6 $
UserTag email-raw Version $Revision: 1.7 $
UserTag email-raw Routine <<EOR
sub {
my($opt, $body) = @_;
Expand Down Expand Up @@ -37,12 +37,25 @@ sub {
}

SEND: {
open(Vend::MAIL,"|$Vend::Cfg->{SendMailProgram} -t") or last SEND;
print Vend::MAIL $body
or last SEND;
close Vend::MAIL
or last SEND;
$ok = ($? == 0);
my $using = $Vend::Cfg->{SendMailProgram};

if (lc $using eq 'none') {
$ok = 1;
last SEND;
} elsif (lc $using eq 'net::smtp') {
$body =~ s/^(.+?)(?:\r?\n){2}//s;
my $headers = $1;
last SEND unless $headers;
my @head = split(/\r?\n/,$headers);
$ok = send_mail(\@head,$body);
} else {
open(Vend::MAIL,"|$using -t") or last SEND;
print Vend::MAIL $body
or last SEND;
close Vend::MAIL
or last SEND;
$ok = ($? == 0);
}
}

if (!$ok) {
Expand Down

0 comments on commit d821564

Please sign in to comment.