Skip to content

Commit

Permalink
Support aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
orgads committed Dec 8, 2011
1 parent f1a8e93 commit fa0cd61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/simpleMailer.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fa0cd61

Please sign in to comment.