Sendmail Script: Gmail cannot find attachments


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sendmail Script: Gmail cannot find attachments
# 1  
Old 06-06-2012
Sendmail Script: Gmail cannot find attachments

Hi.

I am using a script on HP-UX to send emails that include a Pdf attachment to clients. The scipt makes use of sendmail.

The scripts works for everything except gmail. When I go on gmail via my Web Browser, I can see the message with the attachment, but if I try to view or download the attachment, gmail tells me that the attachment cannot be found at its original source.

If I use this same script to send the message to my hotmail account or my work email, everything is fine.

Can somebody please help? The script is shown below.

Code:
echo "From: ${MAIL_FROM}" > $MSG_FILE
echo "To: ${MAIL_TO}" >> $MSG_FILE
echo "Subject: ${SUBJECT}" >> $MSG_FILE
echo "MIME-Version: 1.0" >> $MSG_FILE
echo 'Content-Type: multipart/mixed; boundary="--_GvXjxJ+pjyke8COw"' >> $MSG_FILE
echo " " >> $MSG_FILE
echo "----_GvXjxJ+pjyke8COw" >> $MSG_FILE
echo "Content-Type: text/plain; charset=ISO-8859-1" >> $MSG_FILE
echo "Content-Disposition: inline" >> $MSG_FILE
echo " " >> $MSG_FILE
cat $BODY_FILE >> $MSG_FILE
echo " " >> $MSG_FILE
echo "----_GvXjxJ+pjyke8COw" >> $MSG_FILE
echo "Content-Type: application/octet-stream" >> $MSG_FILE
echo "Content-Disposition: inline; filename=${ATT_FILE_NAME}" >> $MSG_FILE
echo "Content-transfer-encoding: X-UUencode">>${MSG_FILE}
echo " " >> $MSG_FILE
/usr/bin/uuencode  ${ATT_FILE} ${ATT_FILE} >> ${MSG_FILE}
echo " " >> $MSG_FILE
echo "----_GvXjxJ+pjyke8COw--" >> $MSG_FILE
echo " " >> $MSG_FILE
/usr/lib/sendmail ${MAIL_TO} < ${MSG_FILE};EXITSTATUS=$?


Last edited by methyl; 06-06-2012 at 12:34 PM.. Reason: not finished ; please use code tags
# 2  
Old 06-06-2012
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
# 3  
Old 06-06-2012
What are the values of these two variables?
Quote:
${ATT_FILE_NAME}
${ATT_FILE}
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sendmail - Attachments & Subjects

Hi All, Not been around in a while. However I have been all over tinternet (google) for days looking for a solution. Where I work has decided to use Sendmail on our Linux and Unix estate for sending emails via scripts. So I am hoping to eventually get a working solution for Sendmail and not... (3 Replies)
Discussion started by: dakelly
3 Replies

2. Web Development

Gmail very slow to receive Sendmail/PHP Mail

Okay, I have searched the forums and couldn't really find a topic on this, so I decided to start one. But I decided to start a ncurses discussion forum recently and one thing I noticed while getting it going is that when mail is sent out via Sendmail or PHP Mail, Gmail is /very/ slow to receive it.... (2 Replies)
Discussion started by: Phobos D'thorga
2 Replies

3. Shell Programming and Scripting

Mailing multiple PNG attachments using sendmail

Need assistance in using the below script and having multiple png file attachments in the same script . Your inputs are appreciated. I dont have uuencode , I use either mailx, sendmail, mpack . ( echo "to: samplemail@somewhere.com" echo "from: samplemail@elsewhere.com" echo "subject:... (2 Replies)
Discussion started by: ajayram_arya
2 Replies

4. Shell Programming and Scripting

Sendmail gz Attachments

Hi All, I have a problem again with sendmail content type . I am trying to attach the gz file to the html email but couldnt figure out even after extensive google. Here is my code. ( echo "From: $FROM" echo "To: $MAILTO" echo... (3 Replies)
Discussion started by: posner
3 Replies

5. Shell Programming and Scripting

Sendmail Png Attachments

I use sendmail to send html emails, my script works perfect and sends email with plain text attachment. Now i need to attache png file to the email and this attachment part is not working. ( echo "From: $FROM" echo "To: $TO" echo "MIME-Version: 1.0" echo "Subject: $SUBJECT" echo... (4 Replies)
Discussion started by: posner
4 Replies

6. Shell Programming and Scripting

Gmail Authentication from shell script

Hello All, I want my script to accept Gmail user name and password from command line and authenticate that user .Is it possible ? I heard about doing it using Google API's but not able to find right material on net. (1 Reply)
Discussion started by: anand.shah
1 Replies

7. Shell Programming and Scripting

Sendmail attachment problem on Gmail

Hi. I am a user on HP-UX , OS Version 11.23 with the Itanium architecture. I am using a script on HP-UX to send emails that include a Pdf attachment to clients. The scipt makes use of sendmail. The scripts works for everything except gmail. When I go on gmail via my Web Browser, I can see... (4 Replies)
Discussion started by: Wahooka
4 Replies

8. Shell Programming and Scripting

Can I access gmail or hotmail from Unix script?

Hi, I wonder how can I access gmail or hotmail from Unix script? ksh? Thank you in advance for any advices. (2 Replies)
Discussion started by: tanit
2 Replies

9. Shell Programming and Scripting

sendmail with attachments

Hi, I got the following script from Ygor on this site: #!/usr/bin/ksh export MAILTO="email_address" export CONTENT="/export/home/aisdba/email_body.html" export SUBJECT="subject of email" ( echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" echo "Content-Type: text/html" echo... (9 Replies)
Discussion started by: suthera
9 Replies

10. UNIX for Dummies Questions & Answers

sendmail attachments

Dear all, I've been working with AIX for, um, 15 years now and I have read all I can about the above, but I am stuck. Everything seems to point to using sendmail on the command line to embed a uuencoded attatchment will not work. Using something like "(cat plain.txt;uuencode attach.file... (4 Replies)
Discussion started by: rbatte1
4 Replies
Login or Register to Ask a Question