yandex_mail 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.DS_Store +0 -0
- data/README.md +27 -0
- data/bin/yandex_mail +16 -0
- data/lib/version.rb +3 -0
- data/lib/yandex_mail.rb +28 -0
- data/yandex_mail.gemspec +23 -0
- metadata +66 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f42220cb43f32e428d235201fff578425c729f12
|
4
|
+
data.tar.gz: 78fac0378a5ee6ea4aa31b09f01f1e2e136d1288
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 61f0591a45b74494bbf1129ca33f03ef14d1a730fdbe5f75d03b718510a58f435bd6b47ef0943f2623f045c1a6e0491857fb3012b6af4429026bd4515f9e7e7a
|
7
|
+
data.tar.gz: e662127628450fe2a87ccd747e36ce6bc084dcf677a8fb38af9f7c8b1c490c47caca210af608a33bf9f9eb47b46a7e9909d3e83ea6fe9c6a571d3de813b85ae1
|
data/.DS_Store
ADDED
Binary file
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Yamail
|
2
|
+
Mail sebder over Yandex SMTP server
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
Install ruby gem
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem install yandex_mail
|
9
|
+
```
|
10
|
+
|
11
|
+
Create config file in your home directory called .yandexmail
|
12
|
+
|
13
|
+
```yaml
|
14
|
+
# ~/.yandexmail
|
15
|
+
|
16
|
+
user_name: yourname@yandex.ru
|
17
|
+
password: your_password
|
18
|
+
|
19
|
+
```
|
20
|
+
|
21
|
+
## How to
|
22
|
+
|
23
|
+
For example
|
24
|
+
|
25
|
+
```
|
26
|
+
yandex_mail recipient@email.com 'email subject' 'email body'
|
27
|
+
```
|
data/bin/yandex_mail
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if ARGV.length != 3
|
4
|
+
puts "\e[1;32m\ Usage: \e[0m\ #{File.basename(__FILE__)} recipient@email.com \"email subject\" \"email body\""
|
5
|
+
Process.exit
|
6
|
+
end
|
7
|
+
|
8
|
+
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
9
|
+
require 'yandex_mail'
|
10
|
+
|
11
|
+
to = ARGV[0]
|
12
|
+
msg = ARGV[1]
|
13
|
+
txt = ARGV[2]
|
14
|
+
|
15
|
+
Yandexmail.line(to, msg, txt).deliver
|
16
|
+
puts "\e[1;32m\OK: Email sent to : \e[1;31m\ #{to}"
|
data/lib/version.rb
ADDED
data/lib/yandex_mail.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'action_mailer'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
def smtp_config
|
6
|
+
file = File.expand_path('~/.yandexmail')
|
7
|
+
raise "No configuration file found! Please provide one at #{file}" unless File.exists? file
|
8
|
+
@config ||= YAML::load(File.open(file))
|
9
|
+
end
|
10
|
+
|
11
|
+
ActionMailer::Base.delivery_method = :smtp
|
12
|
+
ActionMailer::Base.smtp_settings = {
|
13
|
+
:address => "smtp.yandex.ru",
|
14
|
+
:port => 587,
|
15
|
+
:domain => "yandex.ru",
|
16
|
+
:authentication => :plain,
|
17
|
+
:user_name => smtp_config["user_name"],
|
18
|
+
:password => smtp_config["password"]
|
19
|
+
}
|
20
|
+
|
21
|
+
class Yandexmail < ActionMailer::Base
|
22
|
+
def line(t, sub, mess)
|
23
|
+
from smtp_config["user_name"]
|
24
|
+
recipients t
|
25
|
+
subject "#{sub}"
|
26
|
+
body "#{mess}"
|
27
|
+
end
|
28
|
+
end
|
data/yandex_mail.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'lib')
|
2
|
+
require "version"
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "yandex_mail"
|
6
|
+
s.version = Yandexmail::VERSION
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = ["Peter Boriskin"]
|
9
|
+
s.email = ["x66w@ya.ru"]
|
10
|
+
s.homepage = "http://github.com/sanata-/yandex_mail"
|
11
|
+
s.license = "MIT"
|
12
|
+
s.add_dependency "actionmailer", "= 3.0.7"
|
13
|
+
|
14
|
+
|
15
|
+
s.summary = %q{CLI mailer for for sending email via Yandex SMTP server}
|
16
|
+
s.description = %q{Send emails using a given Yandex email account. Only username/passwords needed.}
|
17
|
+
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
s.executables = `git ls-files -- bin/yandex_mail`.split("\n").map{ |f| File.basename(f) }
|
21
|
+
s.require_paths = ["lib"]
|
22
|
+
s.required_ruby_version = '>= 1.8.7'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: yandex_mail
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Boriskin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: actionmailer
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.0.7
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.0.7
|
27
|
+
description: Send emails using a given Yandex email account. Only username/passwords
|
28
|
+
needed.
|
29
|
+
email:
|
30
|
+
- x66w@ya.ru
|
31
|
+
executables:
|
32
|
+
- yandex_mail
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- ".DS_Store"
|
37
|
+
- README.md
|
38
|
+
- bin/yandex_mail
|
39
|
+
- lib/version.rb
|
40
|
+
- lib/yandex_mail.rb
|
41
|
+
- yandex_mail.gemspec
|
42
|
+
homepage: http://github.com/sanata-/yandex_mail
|
43
|
+
licenses:
|
44
|
+
- MIT
|
45
|
+
metadata: {}
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.8.7
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
requirements: []
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 2.4.6
|
63
|
+
signing_key:
|
64
|
+
specification_version: 4
|
65
|
+
summary: CLI mailer for for sending email via Yandex SMTP server
|
66
|
+
test_files: []
|