On 3/11/07, peter <ruby / iwebsl.com> wrote:
> I'm trying to use Net::SMTP which appears to do most everything I need
> except for one thing. In the example below I need to replace
> recipient / host.com with a variable based on the submitting users email
> address #{email) but nothing I have tried works. In most cases I get a
> tainted sender error. How can I use this and have a variable recipient?
>
> Net::SMTP.start('mail', 25) do |smtp|
> smtp.open_message_stream('sender / mail.com', ['recipient / host.com']) do |
> f|
> f.puts "From: sender sender / mail.com"
> f.puts "To: #{name} #{email}"

It looks like the problem might be that the recipient email in the
header doesn't match the one you gave when you opened the stream.

Assuming that the email variable contains the real recipient , have you tried:
smtp.open_message_stream('sender / mail.com', [email]) do |
  f|
  f.puts "From: sender sender / mail.com"
  f.puts "To: #{name} #{email}"
...


-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

IPMS/USA Region 12 Coordinator
http://ipmsr12.denhaven2.com/

Visit the Project Mercury Wiki Site
http://www.mercuryspacecraft.com/