Forum: Ruby ruby to send email attachments

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
02bd6b98b7c04f9ae5868eda3d01fb73?d=identicon&s=25 rtilley (Guest)
on 2006-04-02 16:26
(Received via mailing list)
I searched the news group and found a script that sends email with
attachments. I modified it a bit to loop through an array sending to
multiple recipients, however, it seems that addresses with a '_' or a
'-' in them will sometimes produce an error on sending.

The script is too long to post here. Here is a link to it:
http://filebox.vt.edu/users/rtilley/public/email.rb

Would someone look it over to see what I'm doing wrong? I'm relatively
new to Ruby, so I'm sure I've just done something wrong. Perhaps it's
how I read the email addresses into an array?

Also, how would I insert a message-id into emails? Our mail server
complains when a message comes through without one and inserts one
itself. No big deal really, it just raises the spam score a tiny bit
(not that I spam)... these are legit emails.

Thanks to anyone who can offer help or advice!
Brad
E51d56251ec4affafe85ee9367228965?d=identicon&s=25 Park Heesob (Guest)
on 2006-04-03 03:15
(Received via mailing list)
Hi,

>
insert this line
    smtp.set_debug_output $stderr
after the line
    smtp = Net::SMTP.new(@server)
and examine the debug messages.

>spam)... these are legit emails.
>
insert message-id like this
      wa.write("Message-ID:
<000001c656e2$a8217380$0100007f@localhost>\r\n")
after the line
      wa.write("MIME-Version: 1.0\r\n")

>Thanks to anyone who can offer help or advice!
>Brad
>
Hope this helps,

Park Heesob
801b207647d808477fc4514568c9d723?d=identicon&s=25 Dimitri Aivaliotis (Guest)
on 2006-04-03 15:40
(Received via mailing list)
Hi Brad,

On 4/2/06, rtilley <rtilley@vt.edu> wrote:
> I searched the news group and found a script that sends email with
> attachments.

You might want to check out SimpleMail
(http://simplemail.rubyforge.org/).  That's the library I've been
using to send out scripted emails.

- Dimitri
This topic is locked and can not be replied to.