Hello,
I have to send mail to multiple recipients. I have one text file, it
contains emailaddress. In ruby program i should parse the emailaddresses
and send to multiple recipients. for example. Just parsing it into an
Array and either iterate over the array (sending one e-mail for each
address)
Give any ideas for this one, also give related program for this.

Thanks in advance

If I got your question right, you have the e-mail addresses in a text file.

Then i suggest you open the file, convert it's content to a single string and use the string scan method to scan for e-mail addresses, use a suitable regular expression and then an array of e-mail addresses would be returned then you can iterate through those and send them.

google for chilkatRuby libraries, it offers various modules to send emails simply.
Hope i answered your question

Hi all!,
can anyone help me. i'm facing the same problem but difference is that i have to select recipients from check boxes and then to click on send mail so that another page opens and i can get there email addresses on to: section and i can mail them from there. but i'm unable to get this even if i'm using an array

<%= check_box("contactID", contact.id, {:checked => strChecked, :onclick => "doUncheck()"}, "yes", "no") %>

from="#{emailFrom}"
                  
                    from_alias='the sender'
                    to="#{customer.ContactEmail}"
                    
                    to_alias='the recipient'
                    smtp_host="#{path}"
                    
                    port="#{port}"	# default port is 25
                    user="#{username}"
                    password="#{password}"

    myMessage = <<END_OF_MESSAGE
From:  <#{from}>
To:  <#{to}>
Subject: #{subOfMail} 

#{tempContent}
END_OF_MESSAGE
                    begin
                    Net::SMTP.start(smtp_host, port, from, user, password, :login) do |smtp|
                    smtp.send_message myMessage, from, to
                    end
					rescue Exception => e
					flash[:message] = "Processing Failed:Your Server Details are not correct."
					redirect_to :action => 'list'
					return false
					end
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.