Skip to content

Commit

Permalink
Item13936: Didn't fully fix the test email.
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Nov 14, 2016
1 parent 5035bae commit 1267139
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions core/lib/Foswiki/Configure/Wizards/SendTestEmail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ sub send {
$noredirect = 1; # FCGI doesn't allow redirection of STDERR
}

eval { _sendTestEmail( $Foswiki::cfg{WebMasterEmail}, $reporter ); };
eval { _sendTestEmail($reporter); };
die $@ if $@;
return undef; # return the report
}

# Send a test email to the address in the value
sub _sendTestEmail {
my ( $addrs, $reporter ) = @_;
my $reporter = shift;

my $fromName = $Foswiki::cfg{Email}{WikiAgentName}
|| $Foswiki::cfg{WebMasterName};
my $fromAddr = $Foswiki::cfg{Email}{WikiAgentEmail}
|| $Foswiki::cfg{WebMasterEmail};

require Foswiki::Net;

Expand Down Expand Up @@ -99,15 +104,10 @@ SMIME
my $smimePlainText = $smimeHTMLText;
$smimePlainText =~ s/<[^>]*>//g;

my $fromName = $Foswiki::cfg{WikiAgentName}
|| $Foswiki::cfg{WebMasterName};
my $fromAddr = $Foswiki::cfg{WikiAgentEmail}
|| $Foswiki::cfg{WebMasterEmail};

my $msg = << "MAILTEST";
From: "$fromName" <$fromAddr>
To: $addrs
Subject: Test of Foswiki e-mail to $addrs
To: "$Foswiki::cfg{WebMasterName}" <$Foswiki::cfg{WebMasterEmail}>
Subject: Test of Foswiki e-mail to $Foswiki::cfg{WebMasterName}
Auto-Submitted: auto-generated
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="=_=0i0k0i0w0s0o0fXuOi0E0A"
Expand Down Expand Up @@ -421,7 +421,8 @@ MAILTEST
}

$reporter->NOTE(<<ACCEPTED);
Mail was accepted for delivery to $addrs from $Foswiki::cfg{WebMasterEmail}. Be sure to check any SPAM and Bulk-email folders before assuming that delivery has failed.
Mail was accepted for delivery to $Foswiki::cfg{WebMasterName} &lt;$Foswiki::cfg{WebMasterEmail}&gt; from "$fromName" &lt;$fromAddr&gt;.
Be sure to check any SPAM and Bulk-email folders before assuming that delivery has failed.
ACCEPTED
}

Expand Down

0 comments on commit 1267139

Please sign in to comment.