Sending an email with mail function shows up as an attachment 'noname'


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sending an email with mail function shows up as an attachment 'noname'
# 1  
Old 05-21-2014
Sending an email with mail function shows up as an attachment 'noname'

I have a file named email.html with this as the contents:

Content-type: text/html
Code:
ACHI,ACCRETIVE HEALTH ,7.15,<br>CPRT,Copart Inc.,36.14,<br>GEOB.MX,GEO-B,1.660,<br>GCO,Genesco Inc. Comm,73.58,<br>GMAN,Gordmans Stores, ,<br>GES,Guess? Inc. Comm,26.45,<br>KBR,KBR Inc. Common ,22.89,<br>MVN.V,MADALENA ENERGY I,0.62,<br>MEI.V,MANITOK ENERGY IN,2.47,<br>MLAB,Mesa Laboratories,76.80,<br>PTA.V,PETROAMERICA OIL ,0.295,<br>SPDC,Speed Commerce I,3.27,<br>SRN.V,SUROCO ENERGY INC,0.51,<br>TWGP,Tower Group Inter,2.18,<br>UNFI,United Natural Fo,66.72,<br>VGQ.TO,VIRGINIA MINES IN,12.00,

And I'm trying to send an email with that file as the content using the mail function in shell. So I do this:
Code:
cat email.html | mail -s "a subject" myemail@gmail.com

However, when the email arrives, there is nothing in body. There is only a file attached called "noname" with the original email.html contents.


Could anyone help me out? Googling has not been helpful

Last edited by Franklin52; 05-22-2014 at 03:52 AM.. Reason: Please use code tags
# 2  
Old 05-22-2014
Maybe your mail text has a first line
Code:
Content-type: text/html

and your mail program (or your MTA) appends the first line(s) to the mail header.
Then, it depends on your mail reader how this is displayed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed for sending email attachment

Hi Please help me how to send email attchment from linux server to outlook id I dont have uuencode or mutt installed on my machine and below is my uname -a output: Linux xxxxxxx 2.6.18-308.4.1.el5 #1 SMP Wed Mar 28 01:54:56 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux (7 Replies)
Discussion started by: buzzme
7 Replies

2. Shell Programming and Scripting

Sending a file as an attachment to email

The file is located under appl/batchdata/ file name: storesales.txt I am using following code because uuencode is not present. I am not getting the data in file but i am getting the blank file with same name as an email attachment. ( echo "from: sch@xxxx.com" echo "to:sch@xxxx.com" echo... (2 Replies)
Discussion started by: skatpally
2 Replies

3. UNIX for Advanced & Expert Users

Sending mail with attachment

Hi, I am using Sun solaris OS unix server I am trying to send mail with an attachment using below script cat test.txt;uuencode test.txt test.txt|mailx -s "$subject" someone@somewhere I m getting mails but with no attachment. Hence i manipulate the script as below and i am... (2 Replies)
Discussion started by: sv0081493
2 Replies

4. Shell Programming and Scripting

sending an email with attachment

Hi, Please help me in sending an e-mail with attachment through unix mailx command is not present in our unix box. (4 Replies)
Discussion started by: dudd9
4 Replies

5. UNIX for Dummies Questions & Answers

Sending email with attachment and body

Hi I want to able to attach a file to a email and send it with a body the body of the email is within the "body" file, and the attachment in "atch" if i send like below it will send the email correctly /usr/sbin/sendmail me@you.com< body And when i send the attachment alone... (3 Replies)
Discussion started by: sridanu
3 Replies

6. Shell Programming and Scripting

Not able to attach text in body of email while sending mail with attachment

Hi, We have been trying to send mail with attachment and it is going fine, but when we try to attach a text to the body of the email, we find that the mail is going fine with the body text but the attachment is not going through. We are using ksh. The command that is successfull without the... (6 Replies)
Discussion started by: jmathew99
6 Replies

7. Shell Programming and Scripting

Sending Email with Attachment

Hi, I want to send an email with multiple attachment using uuencode and mail command. I am able to send with one attachment Ex:uuencode abc.txt abc.txt | mail test@test.com -s "Test3" Can anyone reply with syntax. Regards BS (3 Replies)
Discussion started by: balajiora
3 Replies

8. Shell Programming and Scripting

sending an attachment through email

As a part of requirement I need to send out mails with attachment from UNIX. I have to take query the Oracle DB and send the result of the query in an attachment through mail. I use the following script for the same. #!/bin/csh #!/bin/bash #!/bin/ksh ATTFILE=/folder1/test.xls cd... (1 Reply)
Discussion started by: Sgiri1
1 Replies

9. Programming

C code for Sending Email with attachment

Hi, I need the C code for Sending Email with attachment through SMTP protocol, running under linux platform. Thanks (1 Reply)
Discussion started by: Mr coder
1 Replies

10. UNIX for Dummies Questions & Answers

Sending attachment thru a mail

Is there any way we can send file attachemnts through mails from a unix server. Does the 'mail' command have such an option ?? (1 Reply)
Discussion started by: Rohini Vijay
1 Replies
Login or Register to Ask a Question