sendcloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'rest_client' | |
def send_mail | |
response = RestClient.post "http://api.sendcloud.net/apiv2/mail/send", | |
:apiUser => 'ahelp17cow_test_rSoOwt', # 使用api_user和api_key进行验证 | |
:apiKey => '', | |
:from => "help@17cow.com", # 发信人,用正确邮件地址替代 | |
:fromName => "SendCloud", | |
:to => "aheadwinder@qq.com", # 收件人地址,用正确邮件地址替代,多个地址用';'分隔 | |
:subject => "SendCloud ruby webapi common example", | |
:html => '欢迎使用SendCloud' | |
return response | |
end | |
response = send_mail | |
puts response.code | |
puts response.to_str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment