The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Patch Management over mixed unix platforms jimthompson UNIX for Advanced & Expert Users 3 09-04-2008 06:00 AM
Script needed to select and delete lower case and mixed case records abhilash mn Shell Programming and Scripting 1 03-17-2008 08:00 AM
How do I compare mixed variables? monx Shell Programming and Scripting 6 03-26-2007 09:37 PM
output only numbers from mixed string nortypig Shell Programming and Scripting 10 08-29-2006 10:30 PM
Printer Sharing on a Mixed(Windows/Linux) Home Network Annatar IP Networking 1 12-13-2005 12:27 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-25-2006
Indalecio Indalecio is offline
Registered User
  
 

Join Date: Sep 2006
Location: Sweden
Posts: 59
Problems using multipart/mixed

Hi all

I'm having trouble using MIME's multipart/mixed content type. I just try to send an email with a common body text together with an attachment (.gif). The only output I get is an empty email with no text and an invalid attachment (MS Outlook says it doesn't recognize the attachment type). Both text body and attachment show up when sent separately (i.e. not using muiltipart/mixed) which should prove my encoding is correct.

Here is the code:
Code:
#!/usr/bin/ksh 
 
echo "To: \"User\" <user@domain.com>" > mailtest 
echo "Subject: Testing attachments" >> mailtest 
echo "MIME-Version: 1.0" >> mailtest 
echo "From: \"My Test\" <bass@europolitan.se>" >> mailtest 
echo "Content-Type: multipart/mixed; boundary=\"sendfile-attachment-boundary\"" >> mailtest 
 
echo "--sendfile-attachment-boundary" >> mailtest 
echo "Content-Type: text/plain; charset=\"us-ascii\"" >> mailtest 
echo "Hello how are you?" >> mailtest 
 
echo "--sendfile-attachment-boundary" >> mailtest 
echo "Content-Type: image/gif; name=\"header_logo_trans.gif\"" >> mailtest 
echo "Content-Transfer-Encoding: base64" >> mailtest 
echo "Content-Disposition: attachment" >> mailtest 
base64-1.4/base64 -e header_logo_trans.gif >> mailtest 
echo "--sendfile-attachment-boundary--" >> mailtest 
 
cat mailtest | mail user@domain.com 
 
exit 0
Now I just wonder if anybody on this forum could easily identify the error (if there is one ). I´ve searched for hours on the internet and found some examples but it mostly tended to say my above code was correct...

Many thanks,
Yann

PS: I first searched for an answer in the FAQ and found a topic. However I didn't feel more clever having read it

Last edited by Indalecio; 09-25-2006 at 08:42 AM..
  #2 (permalink)  
Old 09-25-2006
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
Have a look at this post.
  #3 (permalink)  
Old 09-26-2006
Indalecio Indalecio is offline
Registered User
  
 

Join Date: Sep 2006
Location: Sweden
Posts: 59
Thank you for your reply!
I could finally make it work thanks to the post you refered to. I had in fact too few boundaries within my email structure.
Cheers,
Yann
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0