質問編集履歴
6
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -73,7 +73,7 @@
|
|
73
73
|
s = Net::SMTP.new("smtp.gmail.com","587")
|
74
74
|
smtp = s.start("smtp.gmail.com","587")#ポートを記入しないとエラーになる。
|
75
75
|
smtp.starttls
|
76
|
-
smtp.authenticate("
|
76
|
+
smtp.authenticate("matsukazu0409","パスワード",":plain")
|
77
77
|
smtp.open_message_stream("matsukazu0409@gmail.com","matsu-kazu4@ezweb.ne.jp"){|mail|
|
78
78
|
}
|
79
79
|
```
|
5
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -66,4 +66,14 @@
|
|
66
66
|
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:565:in `do_start'
|
67
67
|
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:518:in `start'
|
68
68
|
from sample2.rb:2:in `<main>'
|
69
|
+
```
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
require 'net/smtp'
|
73
|
+
s = Net::SMTP.new("smtp.gmail.com","587")
|
74
|
+
smtp = s.start("smtp.gmail.com","587")#ポートを記入しないとエラーになる。
|
75
|
+
smtp.starttls
|
76
|
+
smtp.authenticate("kazuya0409","パスワード",":plain")
|
77
|
+
smtp.open_message_stream("matsukazu0409@gmail.com","matsu-kazu4@ezweb.ne.jp"){|mail|
|
78
|
+
}
|
69
79
|
```
|
4
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -44,4 +44,26 @@
|
|
44
44
|
f.open_message_stream("matsukazu0409@gmail.com", "matsu-kazu4@ezweb.ne.jp"){|m|
|
45
45
|
}
|
46
46
|
}
|
47
|
+
```
|
48
|
+
|
49
|
+
```cmd
|
50
|
+
#starttls追記前
|
51
|
+
C:\Users\u16154\Desktop\ruby_lesson>ruby sample2.rb
|
52
|
+
C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:981:in `check_auth_response': 530 5.7.0 Must issue a STARTTLS command first. y128sm103149625pgy.41 - gsmtp (Net::SMTPAuthenticationError)
|
53
|
+
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:736:in `auth_plain'
|
54
|
+
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:728:in `authenticate'
|
55
|
+
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:565:in `do_start'
|
56
|
+
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:518:in `start'
|
57
|
+
from sample2.rb:2:in `<main>'
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
#starttls追記後
|
62
|
+
C:\Users\u16154\Desktop\ruby_lesson>ruby sample2.rb
|
63
|
+
C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:981:in `check_auth_response': 530 5.7.0 Must issue a STARTTLS command first. u16sm15528930pjb.2 - gsmtp (Net::SMTPAuthenticationError)
|
64
|
+
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:736:in `auth_plain'
|
65
|
+
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:728:in `authenticate'
|
66
|
+
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:565:in `do_start'
|
67
|
+
from C:/Ruby24-x64/lib/ruby/2.4.0/net/smtp.rb:518:in `start'
|
68
|
+
from sample2.rb:2:in `<main>'
|
47
69
|
```
|
3
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -33,4 +33,15 @@
|
|
33
33
|
何が原因なのでしょうか?
|
34
34
|
startメソッドに渡す引数が間違っているのか
|
35
35
|
|
36
|
-
原因が分からないので参考になるリンクまたは説明をお願いします。
|
36
|
+
原因が分からないので参考になるリンクまたは説明をお願いします。
|
37
|
+
|
38
|
+
|
39
|
+
**追記**
|
40
|
+
```ruby
|
41
|
+
require 'net/smtp'
|
42
|
+
Net::SMTP.new("smtp.gmail.com",587).start("matsukazu0409","パスワード",":plain"){|f|
|
43
|
+
f.starttls
|
44
|
+
f.open_message_stream("matsukazu0409@gmail.com", "matsu-kazu4@ezweb.ne.jp"){|m|
|
45
|
+
}
|
46
|
+
}
|
47
|
+
```
|
2
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
```ruby
|
7
7
|
require 'net/smtp'
|
8
8
|
Net::SMTP.new("smtp.gmail.com",587).start("matsukazu0409","パスワード",":plain"){|f|
|
9
|
-
|
9
|
+
f.open_message_stream("matsukazu0409@gmail.com", "matsu-kazu4@ezweb.ne.jp"){|m|
|
10
10
|
}
|
11
11
|
}
|
12
12
|
```
|
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -21,8 +21,8 @@
|
|
21
21
|
from sample2.rb:2:in `<main>'
|
22
22
|
```
|
23
23
|
([STARTTLS](http://blog.smtps.jp/entry/2017/09/07/114820))
|
24
|
+
一度非暗号化で通信を開始した後 STARTTLS コマンドを実行し、途中から暗号化ありの通信にアップグレードする手法
|
24
25
|
|
25
|
-
|
26
26
|

|
27
27
|
|
28
28
|
startの引数のauthtype(認証のタイプ)を一通り試したのですがだめでした。
|