The interviewer asked how to do the ten million level email publishing system? MailBee can be reached in 2 minutes

Today, when making MailBee series products, I remembered the embarrassing scene of being asked by an interviewer when I went to the interview in 2014.

Generally, I recommend using self built smtp email to push small systems. There is still no problem pushing 1000 emails a day; If a small website needs more push volume, Alibaba cloud push interface can be considered.

/**
 * Alibaba cloud communication sends short message 2017
 * @param string $mobile    Receive mobile phone number
 * @param string $tplCode   SMS template ID
 * @param array  $tplParam  SMS content
 * @return array
 */
function sendMsg($mobile, $tplCode, $tplParam)
{
    require_once '../extend/aliyunsms/vendor/autoload.php';
    Config::load(); //Load area node configuration
    $accessKeyId = config('alisms_appkey');
    $accessKeySecret = config('alisms_appsecret');
    $templateParam = $tplParam; //Template variable replacement
    $signName = config('alisms_signname');
    //SMS template ID
    $templateCode = $tplCode;
    $product = "Dysmsapi";
    $domain = "dysmsapi.aliyuncs.com";
    $region = "cn-hangzhou";
    $profile = DefaultProfile::getProfile($region, $accessKeyId, $accessKeySecret);
    // Add service node
    DefaultProfile::addEndpoint("cn-hangzhou", "cn-hangzhou", $product, $domain);
    // Initialize the AcsClient to initiate the request
    $acsClient = new DefaultAcsClient($profile);
    $request->setPhoneNumbers($mobile);
    $request->setSignName($signName);
    // Required, set template CODE
    $request->setTemplateCode($templateCode);
    // Optional, set template parameters
    if ($templateParam) {
        $request->setTemplateParam(json_encode($templateParam));
    }
    //Initiate access request
    $acsResponse = $acsClient->getAcsResponse($request);
    saveSendlog('sms', $mobile, $json_encode($acsResponse));
    $result = json_decode(json_encode($acsResponse), true);
    return $result;
}

Of course, the above are all routine practices. If you encounter a good way to send tens of thousands of emails every day at the enterprise level and platform level, please continue to look down!

MailBee.NET Objects # is the of creating, sending, receiving and processing e - mail for enterprise distribution NET control. With "required" and unique functions, these controls help developers easily and quickly add complex e-mail functions to their applications. Integration difficulty 0 stars, as shown in the figure above!

But what if you have to send 10000 emails at one time? I'm afraid the loading chart will have to go on for a while.

MailBee.NET Queue is a queue based e-mail sending system. The system can send e-mail faster by relying on its vehicle, because they don't have to wait for e-mail to be sent. This control is particularly important when your application sends multiple messages at a time.

  • MailBee.NET Queue relies on its vehicle to send e-mail more quickly. It should be noted that it is not actually sending e-mail. Your application can turn all e-mail into The eml file is then sent to a specific folder, mailbee Net queue lets all messages be staged first.

  • Inside the file, mailbee Net queue server will always monitor the outgoing folder and wait for all outgoing messages to become After the eml files are, they are sent out. Of course, this specific folder is sent through the SMTP server.

  • MailBee.NET Queue supports SMTP over SSL. It also supports multithreading to greatly improve the sending performance of e-mail.

  • You can use any NET language to tell mailbee NET Queue uses multiple relay SMTP servers for better throughput. Of course, if the SMTP relay server fails when sending directly to the destination MX server, you can limit the number of emails and send them with a single SMTP.

  • To run mailbee Net queue, you need a valid mailbee Net SMTP license key.

  • Since the whole source code is open, you can also use mailbee Net queue to deliver large messages first.

In addition, if you are building an enterprise mail distribution system, there is no need to be embarrassed. MailBee has a variety of targeted [controls] to support NET and PHP. If you are interested, you can click here to have a look.

Keywords: PHP C#

Added by FUNKAM35 on Sun, 30 Jan 2022 15:29:57 +0200