Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Easyemail是一个为简化邮件发送流程而发布的gem.
gem install easyemail
该gem为三个知名的邮件服务商163.com qq.com gmail.com
和我学校(HHU)的邮箱服务做了预先的设置,如果你用来发送邮件的账号来自于以上的邮件服务商,设置smtp的方法如下:
# 以163邮箱为例
# 确保该账号开通了smtp服务
# username 和 password 是你的邮箱账号(账号包括完整后缀)和密码
mailer = Easyemail.new
mailer.smtp_settings_for_163 user_name, password
# 同样的方法还有:
# smtp_settings_for_hhu
# smtp_settings_for_qq
# smtp_settings_for_gmail
如果你使用的不是以上任何一种,设置方法如下:
# 确保该账号开通了smtp服务
# username 和 password 是你的邮箱账号(账号包括完整后缀)和密码
mailer = Easyemail.new
smtp = {
"address" => "**",
"port" => **,
"authentication" => "**",
"user_name" => "**",
"password" => "**",
"enable_starttls_auto" => **
}
mailer.smtp_settings smtp
另外,还可以从yaml配置文件中导入smtp信息,同样的,如果来自以上四个邮件服务商,配置文件可以这样写
provider: ** # (只能从163, qq, gmail, hhu中任选一个)
user_name: **
password: **
否则配置文件需这样写:
address: **
port: **
authentication: **
user_name: **
password: **
enable_starttls_auto: **
调用代码如下:
mailer = Easyemail.new
mailer.load_smtp_settings_from_yaml file_path
允许群发邮件, 设置收件人代码如下:
mailer.to = "someone@**.com" # 单收件人
mailer.to = ["someone@**.com", "**"] # 多收件人
邮件内容支持文本和html格式,两者都以字符串的形式作为参数,调用代码如下:
# subject是邮件主题, content是邮件内容
mailer.email(subject, content)
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that easyemail demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.