Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: kurotoshiro/simpleMailer
base: f1a8e93ffd
...
head fork: kurotoshiro/simpleMailer
compare: 75ec594472
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/simpleMailer.rb
7 lib/simpleMailer.rb
View
@@ -52,6 +52,10 @@ def attach_files(files)
self
end
+ def addr(field)
+ return field.gsub(/[^<]*<([^>]*)>/, '\1')
+ end
+
def generate_file_part(file)
b64file=String.new
filename=File.basename(file)
@@ -96,7 +100,8 @@ def send()
Net::SMTP.start(@host,@port) do |smtp|
begin
generate_body
- smtp.send_message(@body,@from,@to)
+ to = @to.map { |t| addr(t) }.join(', ')
+ smtp.send_message(@body,addr(@from),to)
return true
rescue => e
e

No commit comments for this range

Something went wrong with that request. Please try again.