Project

General

Profile

« Previous | Next » 

Revision 8191

Added by Jing Tao over 11 years ago

Add code to handle the failure of the email server.

View differences:

src/perl/ldapweb.cgi
1009 1009
    my $sender =  $properties->getProperty('email.sender');
1010 1010
    my $recipient = $query->param('mail');
1011 1011
    # Send the email message to them
1012
    my $smtp = Net::SMTP->new($mailhost);
1012
    my $smtp = Net::SMTP->new($mailhost) or do {  
1013
                                                  fullTemplate( ['registerFailed'], {errorMessage => "The temporary account " . $dn . " was created successfully. However, the vertification email can't be sent to you because the email server has some issues. Please contact " . 
1014
                                                  $skinProperties->getProperty("email.recipient") . "." });  
1015
                                                  exit(0);
1016
                                               };
1013 1017
    $smtp->mail($sender);
1014 1018
    $smtp->to($recipient);
1015 1019

  
1016 1020
    my $message = <<"     ENDOFMESSAGE";
1017 1021
    To: $recipient
1018 1022
    From: $sender
1019
    Subject: KNB Password Reset
1023
    Subject: Activate the New KNB Account
1020 1024
        
1021 1025
    Somebody (hopefully you) registered a KNB account.  
1022 1026
    Please click the following link to activate your account.

Also available in: Unified diff