# How to send an email with an Attachment?

**URL:** <https://www.ruby-forum.com/t/how-to-send-an-email-with-an-attachment/139270>\
**Category:** Rails\
**Created:** [June 2, 2008, 2:39pm UTC](https://www.ruby-forum.com/t/how-to-send-an-email-with-an-attachment/139270 "2008-06-02T14:39:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shani1984](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e99b99/32.png) [@shani1984](https://www.ruby-forum.com/u/shani1984)\
**Post date:** [June 2, 2008, 2:39pm UTC](https://www.ruby-forum.com/t/how-to-send-an-email-with-an-attachment/139270/1 "2008-06-02T14:39:17Z")

</div>

Hi…  
I try to send an email with an attachment. I could be able to send the  
Attachment. But it was an empty one . What could be the problem . Here  
is the code that i have used . Please help me to solve this problem .

def  
send\_application(company\_name,your\_name,your\_email,subject,message,cv)  
@subject=subject  
@recipients=your\_name+"\<"+your\_email+"\>"  
@from=your\_email  
@body[‘title’]=subject  
@body[‘email’]=@from  
@body[‘message’]=message  
@body[‘user\_name’]=your\_name

```
    unless cv.blank?

        attachment :body => cv.read, :filename =>

```

cv.original\_filename  
end  
end

thank you…
