2 releases

new 0.1.2 Feb 19, 2025
0.1.1 Feb 18, 2025

#427 in Internationalization (i18n)

Download history

52 downloads per month

MulanPSL-2.0

43KB
423 lines

smtptls

use std::net::IpAddr;

use aok::{OK, Void};
use smtptls::smtptls;
use tracing::info;

#[static_init::constructor(0)]
extern "C" fn _loginit() {
  loginit::init();
}

genv::s!(
  SMTP_PASSWORD,
  SMTP_PORT,
  SMTP_FROM,
  SMTP_USER,
  SMTP_HOST,
  SMTP_IP
);

#[tokio::test]
async fn test() -> Void {
  let smtp_ip: IpAddr = SMTP_IP.parse()?;
  let port: u16 = SMTP_PORT.parse()?;

  info!("{}", &*SMTP_HOST);

  let remain_days = smtptls(
    SMTP_FROM.split('@').next_back().unwrap(),
    (smtp_ip, port),
    &SMTP_USER,
    &SMTP_PASSWORD,
    30,
  )
  .await?
    / 86400;

  info!(?remain_days);
  OK
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Dependencies

~16–26MB
~468K SLoC