/********************************************************************
 * @author:      Kaven
 * @email:       kaven@wuwenkai.com
 * @website:     http://kavenblog.com
 * @file:        [Kaven-Basic] /src/libs/MailConfigBase.ts
 * @create:      2018-08-30 16:08:42.086
 * @modify:      2018-10-26 21:48:27.163
 * @version:     1.1.14
 * @times:       5
 * @lines:       116
 * @copyright:   Copyright © 2018 Kaven. All Rights Reserved.
 * @description: [description]
 * @license:
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 ********************************************************************/
/**
 * @version 1.0.0
 * @since 1.0.5
 */
var MailConfigBase = /** @class */ (function () {
    /**
     *
     * @param host
     * @param port
     * @param ssl
     * @param user
     * @param password
     * @version 1.0.0
     * @since 1.0.5
     */
    function MailConfigBase(host, port, ssl, user, password) {
        this.Host = host;
        this.Port = port;
        this.SSL = ssl;
        this.User = user;
        this.Password = password;
    }
    /**
     * ("Kaven", "kaven@wuwenkai.com") => "Kaven <kaven@wuwenkai.com>"
     * @param name
     * @param address
     * @version 2018-08-18 09:02:18.666
     * @since 1.1.5
     */
    MailConfigBase.GetEmailAddressWithName = function (name, address) {
        return name + " <" + address + ">";
    };
    /**
     *
     * @param email
     * @version 2018-08-18 11:17:57.048
     * @since 1.1.5
     * @see https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript#
     */
    MailConfigBase.IsEmailAddressValid = function (email) {
        // tslint:disable-next-line:max-line-length
        var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        return re.test(email);
    };
    return MailConfigBase;
}());
export { MailConfigBase };
//# sourceMappingURL=MailConfigBase.js.map