# Sending A mailinglist

**URL:** <https://www.ruby-forum.com/t/sending-a-mailinglist/121498>\
**Category:** Rails\
**Created:** [November 28, 2007, 2:21pm UTC](https://www.ruby-forum.com/t/sending-a-mailinglist/121498 "2007-11-28T14:21:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gorter9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/839c29/32.png) [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Post date:** [November 28, 2007, 2:21pm UTC](https://www.ruby-forum.com/t/sending-a-mailinglist/121498/1 "2007-11-28T14:21:54Z")

</div>

I’am building a app where users can describe for a mailinglist.  
But the problem is how can i send a list of mails

```
def mailinglist(mail)
  @mailinglists = Mailinglist.find(:all)
  recipients @mailinglists.email
   from "removed_email_address@domain.invalid"
   subject mail.subject
   body mail.body
  end

```

when is send an email to all adresses on the list i get the error  
undefined method `email’ for #Array:0x25ea53c

Only i can send an mail to one of the members by  
@mailinglists = Mailinglist.find(1)

How can i send a email to all the members of the mailinglist

---

<div class="post-metadata">

**Author:** ![gorter9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/839c29/32.png) [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Post date:** [November 28, 2007, 2:34pm UTC](https://www.ruby-forum.com/t/sending-a-mailinglist/121498/2 "2007-11-28T14:34:54Z")

</div>

def mailinglist(mail)  
@mailinglists = Mailinglist.find(:all)  
@mailinglists.each do |mailingentry|  
recipients mailingentry.email  
from “removed\_email\_address@domain.invalid”  
subject mail.subject  
body mail.body  
end  
end

---

<div class="post-metadata">

**Author:** ![gorter9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/839c29/32.png) [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Post date:** [November 28, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/sending-a-mailinglist/121498/3 "2007-11-28T15:08:19Z")

</div>

That gives no errors but only the first email has sended

---

<div class="post-metadata">

**Author:** ![gorter9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/839c29/32.png) [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Post date:** [November 28, 2007, 3:16pm UTC](https://www.ruby-forum.com/t/sending-a-mailinglist/121498/4 "2007-11-28T15:16:25Z")

</div>

Sorry my fault that other mai adress were slow

Thanks for your solotion you helped me very well with this
