# Resending an mbox file of messages

**URL:** <https://www.ruby-forum.com/t/resending-an-mbox-file-of-messages/111290>\
**Category:** Rails\
**Created:** [August 5, 2007, 3:10am UTC](https://www.ruby-forum.com/t/resending-an-mbox-file-of-messages/111290 "2007-08-05T03:10:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jballanc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/97f17d/32.png) [@jballanc](https://www.ruby-forum.com/u/jballanc)\
**Post date:** [August 5, 2007, 3:10am UTC](https://www.ruby-forum.com/t/resending-an-mbox-file-of-messages/111290/1 "2007-08-05T03:10:16Z")

</div>

I’d like to read in an mbox file and “resend” the message to a  
different SMTP address. The following code seems to work for plain  
text messages but not for MIME messages.

from = removed\_email\_address@domain.invalid  
to = removed\_email\_address@domain.invalid  
mail = tmail.to\_s  
Net::SMTP.start(SMTP\_server, 25) do |smtp|  
smtp.send\_message mail, from, to  
end

Seems like this should be pretty straight forward since I don’t want  
to modify the message body at all.

Any ideas what I should be doing differently for MIME messages?

Thanks!

~Josh
