gemmailing 0.1.1 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f41de004902231eb5fe33135c7f9dafba711d5975d6a6c6fea99e7d8e12aeab8
4
- data.tar.gz: 197616c69bcf86d1197cffcade66c7844239a7803262ce554f182ca27c4c79ba
3
+ metadata.gz: 590cfa96ccffc43eb8afda841580e7b89b39adec3e410b1e69e364a97fdef417
4
+ data.tar.gz: c34fc4fd77ae8583357c268e43d5042fad6ece9bf07384195655a5f5c4cf322d
5
5
  SHA512:
6
- metadata.gz: ac101e46be28ccb5c007b6bbda43f8e85b95a9635dbef0224af1b26ce90577a061204dfa6d4ca8bef6eb27efa580cc4aab58fe6a039b234447ed859a03addb1d
7
- data.tar.gz: 6ba0bd0f91e0c15b2984df041c9c5ef2a3322704b173d06a92cbdcc81ef6e9982b2076a66ddcd89fa2c1f14c784882bca4eb463dfcefd367f737ded98227c053
6
+ metadata.gz: d9f87390384c1c206d47014ce04418add99ccf493bfe3b9a7d6e01f48c30e9308bec1fd4db8e24e76732777aea2c6b8a592c08680b913aacbdebd6951e164ed1
7
+ data.tar.gz: ce23b34bcd3f6ff9d131b9d3cd1e92f628b0909506df141b61a95d693de79d6df1ee6f510950c910c547c6809ccb4206c7993b3442b83fcabf7325d9eba42205
data/gemmailing.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["quangdanang1@gmail.com"]
11
11
 
12
12
  spec.summary = %q{Sening an email easier.}
13
- spec.description = %q{This is an mailing gem test.}
13
+ spec.description = %q{You can send an Email now.}
14
14
  spec.homepage = "https://github.com/chanari/gemmailing"
15
15
  spec.license = "MIT"
16
16
 
@@ -1,3 +1,3 @@
1
1
  module Gemmailing
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/gemmailing.rb CHANGED
@@ -1,7 +1,46 @@
1
1
  require "gemmailing/version"
2
+ require "mail"
3
+ require "net/smtp"
2
4
 
3
5
  module Gemmailing
4
6
  class Error < StandardError; end
5
7
  # Your code goes here...
6
-
8
+
9
+ def self.sendEmail
10
+
11
+ print 'Send to : '
12
+ mailrec = gets.chomp
13
+ print 'Subject : '
14
+ subj = gets.chomp
15
+ print 'Message : '
16
+ mess = gets.chomp
17
+ print 'Your mail : '
18
+ mailsen = gets.chomp
19
+ print 'Your Password: '
20
+ system 'stty -echo'
21
+ mailpas = $stdin.gets.chomp
22
+ system 'stty echo'
23
+ puts
24
+ puts '--- Please Wait ---'
25
+
26
+ Mail.defaults do
27
+ delivery_method :smtp, {
28
+ :address => "smtp.gmail.com",
29
+ :port => 587,
30
+ :domain => 'google.com',
31
+ :user_name => "#{mailsen}",
32
+ :password => "#{mailpas}",
33
+ :authentication => 'plain',
34
+ :enable_starttls_auto => true }
35
+ end
36
+
37
+ Mail.deliver do
38
+ from "#{mailsen}"
39
+ to "#{mailrec}"
40
+ subject "#{subj}"
41
+ body "#{mess}"
42
+ end
43
+ puts '--- Done ---'
44
+
45
+ end
7
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemmailing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - chanari
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.7'
55
- description: This is an mailing gem test.
55
+ description: You can send an Email now.
56
56
  email:
57
57
  - quangdanang1@gmail.com
58
58
  executables: []