The UNIX and Linux Forums  


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
Why no attachment seen??? Amruta Pitkar UNIX for Dummies Questions & Answers 2 04-27-2009 06:22 PM
mail with attachment param786 Shell Programming and Scripting 1 07-15-2007 12:20 PM
attachment using sendmail vastare SUN Solaris 4 01-03-2006 12:56 PM
Mailing an attachment gayath3 UNIX for Dummies Questions & Answers 4 03-21-2005 01:02 AM
Mailing an attachment gayath3 Shell Programming and Scripting 0 03-18-2005 06:09 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-26-2008
jayman jayman is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 1
sendmail attachment

I need to send an email with an attached .pdf file. I am able to send the attcahed file using uuencode as follows (script1) :

ATTFILE=/home/user/test.pdf
ATTNAME=test.pdf
MAILTO=my.receiver@xxx.com
MAILFROM=my.sender@xxx.com

uuencode $ATTFILE $ATTNAME | sendmail -v f${MAILFROM} ${MAILTO}

This code delivers the attached file correctly to my.receiver@xxx.com,
however it ends up in Spam mail with :

From: my.sender@xxx.com
To:
Cc:
Subject:
Attachments : test.pdf

This is doing everything I need, except putting my.receiver@xxx.com in the To: line of the email, which apparently is causing it to end up as SPAM, yet the email does end up at my.receiver@xxx.com's email. Go figure ?

SO the I tried the following (script2) :

ATTFILE=/home/user/test.pdf
ATTNAME=test.pdf
MAILTO=my.receiver@xxx.com
MAILFROM=my.sender@xxx.com

TEMPFILE=tempmail.txt
echo"From:${MAILFROM}\nTo:{MAILTO}\nCc:\nSubject:\n" > TEMPFILE

uuencode ${ATTFILE} ${ATTNAME} | sendmail -t -oi < ${TEMPFILE}

This puts all of the information in the email address lines, and delivers the mail to my.receiver@xxx.com's inbox, but no attachement :

From: my.sender@xxx.com
To: my.receiver@xxx.com
Cc:
Subject:
Attachments :

I need to force the To: line in script1, or make the attachment work
in script2.

Any Ideas ?
 

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 03:56 PM.


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