Sponsored Content
Top Forums Shell Programming and Scripting Sendmail Script: Gmail cannot find attachments Post 302651949 by Wahooka on Wednesday 6th of June 2012 11:19:51 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
RT::Client::REST::Attachment(3pm)			User Contributed Perl Documentation			 RT::Client::REST::Attachment(3pm)

NAME
RT::Client::REST::Attachment -- this object represents an attachment. SYNOPSIS
my $attachments = $ticket->attachments; my $count = $attachments->count; print "There are $count attachments. "; my $iterator = $attachments->get_iterator; while (my $att = &$iterator) { print "Id: ", $att->id, "; Subject: ", $att->subject, " "; } DESCRIPTION
An attachment is a second-class citizen, as it does not exist (at least from the current REST protocol implementation) by itself. At the moment, it is always associated with a ticket (see parent_id attribute). Thus, you will rarely retrieve an attachment by itself; instead, you should use "attachments()" method of RT::Client::REST::Ticket object to get an iterator for all attachments for that ticket. ATTRIBUTES
id Numeric ID of the attachment. creator_id Numeric ID of the user who created the attachment. parent_id Numeric ID of the object the attachment is associated with. This is not a proper attribute of the attachment as specified by REST -- it is simply to store the ID of the RT::Client::REST::Ticket object this attachment belongs to. subject Subject of the attachment. content_type Content type. file_name File name (if any). transaction_id Numeric ID of the RT::Client::REST::Transaction object this attachment is associated with. message_id Message ID. created Time when the attachment was created content Actual content of the attachment. headers Headers (not parsed), if any. parent Parent (not sure what this is yet). content_encoding Content encoding, if any. METHODS
RT::Client::REST::Attachment is a read-only object, so you cannot "store()" it. Also, because it is a second-class citizen, you cannot "search()" or "count()" it -- use "attachments()" method provided by RT::Client::REST::Ticket. retrieve To retrieve an attachment, attributes id and parent_id must be set. INTERNAL METHODS
rt_type Returns 'attachment'. SEE ALSO
RT::Client::REST::Ticket, RT::Client::REST::SearchResult. AUTHOR
Dmitri Tikhonov <dtikhonov@yahoo.com> LICENSE
Perl license with the exception of RT::Client::REST, which is GPLed. perl v5.14.2 2011-12-27 RT::Client::REST::Attachment(3pm)
All times are GMT -4. The time now is 07:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy