jmazzi-pop3-before-smtp-send 0.0.2
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.
- data/README.rdoc +6 -0
- data/bin/pop3-before-smtp-send +43 -0
- data/test/test_helper.rb +2 -0
- metadata +55 -0
data/README.rdoc
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'net/smtp'
|
4
|
+
require 'net/pop'
|
5
|
+
require 'mailfactory'
|
6
|
+
|
7
|
+
abort("Usage: pop3-before-smtp-send <username> <password> <pop server> <smtp server> <to>") unless ARGV.length == 5
|
8
|
+
|
9
|
+
from = ARGV[0]
|
10
|
+
password = ARGV[1]
|
11
|
+
pop_server = ARGV[2]
|
12
|
+
smtp_server = ARGV[3]
|
13
|
+
to = ARGV[4]
|
14
|
+
|
15
|
+
|
16
|
+
Net::POP3.start(pop_server, 110,
|
17
|
+
from, password) do |pop|
|
18
|
+
if pop.mails.empty?
|
19
|
+
puts 'No mail.'
|
20
|
+
else
|
21
|
+
puts "Mail is there"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
# SENDING
|
27
|
+
|
28
|
+
#Connect to SMTP Server
|
29
|
+
smtp = Net::SMTP.new(smtp_server, 25)
|
30
|
+
smtp.start('yourdomain.com')
|
31
|
+
|
32
|
+
#Construct Mail Message
|
33
|
+
mail = MailFactory.new()
|
34
|
+
mail.to = to
|
35
|
+
mail.from = from
|
36
|
+
mail.subject = 'An email from Ruby'
|
37
|
+
mail.html = "<h1>Hello From Ruby!</h1>"
|
38
|
+
|
39
|
+
#Construct SMTP Message
|
40
|
+
smtp.send_message mail.construct, mail.from, mail.to
|
41
|
+
|
42
|
+
#Send this (and all other) message
|
43
|
+
smtp.finish()
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jmazzi-pop3-before-smtp-send
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Justin Mazzi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-12-12 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: ""
|
17
|
+
email: hh@mailheist.com
|
18
|
+
executables:
|
19
|
+
- pop3-before-smtp-send
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- bin/pop3-before-smtp-send
|
26
|
+
- README.rdoc
|
27
|
+
- test/test_helper.rb
|
28
|
+
has_rdoc: false
|
29
|
+
homepage: http://r00tshell.com
|
30
|
+
post_install_message:
|
31
|
+
rdoc_options: []
|
32
|
+
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: "0"
|
40
|
+
version:
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0"
|
46
|
+
version:
|
47
|
+
requirements: []
|
48
|
+
|
49
|
+
rubyforge_project:
|
50
|
+
rubygems_version: 1.2.0
|
51
|
+
signing_key:
|
52
|
+
specification_version: 2
|
53
|
+
summary: This is a CLI for sending mailing via pop3 before smtp.
|
54
|
+
test_files: []
|
55
|
+
|