Sponsored Content
Full Discussion: sendmail with attachments
Top Forums Shell Programming and Scripting sendmail with attachments Post 302351639 by suthera on Wednesday 9th of September 2009 07:18:58 AM
Old 09-09-2009
Thanks Ygor, nothing brought up in the search apart from uuencode sadly. My usual command to attach files to an email is:

uuencode $CSV_FILE $(basename $CSV_FILE)
) | if [ $DATABASE_LIVE = 1 ]
then mailx -b "$COPY_TO" -s "$SUBJECT" -r "$MAIL_FROM" "$MAIL_TO_LIVE"
else mailx -s "$SUBJECT" -r "$MAIL_FROM" "$MAIL_TO_TEST"
fi


However I wanted have the body of the email in MIME or even better (as per your coding) a HTML file that I can construct within my shell script. This makes the body of the email look good (HTML formatting) but also relevant to UNIX Box and Database(s) (with Shell Script variables).

Is there a way to combine the script? Many thanks.
 

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Attachments

Hi I find that the attachment size are very limited. For eg, if we wish to analyse explorers from Sun systems or messages file, definitely they will exceed the given 3.5MB .. Dun you think so?:p (6 Replies)
Discussion started by: incredible
6 Replies

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

3. UNIX and Linux Applications

Attachments in MUTT.

Can any body figure out how to attach the attachments mails while drafting them in MUTT form any location on my system. I am not able to figure it out. (0 Replies)
Discussion started by: nixhead
0 Replies

4. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: Wahooka
2 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

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

7. UNIX for Advanced & Expert Users

Sendmail questions, SCO 5.0.6 sendmail 8.11.0

I am running SCO 5.0.6 and using sendmail 8.11.0 and having issues with smtp authentication. When trying to send mail the following message will kick back. (reason: 530 5.7.1 Authentication required) 530 5.7.1 Authentication required Not sure what needs to be tweeked in sendmail.cf but I... (1 Reply)
Discussion started by: ziggy6
1 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. Solaris

Clarifying sendmail configuration - sendmail-client offline

Hi all, I have read about sendmail running as 2 separate process. 1 as a MSP, and the other as the real daemon or MTA. In my current configuration, the sendmail-client is disabled. Both submit.cf and sendmail.cf are left as default untouch I do not specified any mailhost... (3 Replies)
Discussion started by: javanoob
3 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
Jifty::Notification(3pm)				User Contributed Perl Documentation				  Jifty::Notification(3pm)

NAME
Jifty::Notification - Send emails from Jifty USAGE
It is recommended that you subclass Jifty::Notification and override "body", "html_body", "subject", "recipients", and "from" for each message. (You may want a base class to provide "from", "preface" and "footer" for example.) This lets you keep all of your notifications in the same place. However, if you really want to make a notification type in code without subclassing, you can create a "Jifty::Notification" and call the "set_body", "set_subject", and so on methods on it. METHODS
new [KEY1 => VAL1, ...] Creates a new Jifty::Notification. Any keyword args given are used to call set accessors of the same name. Then it calls "setup". setup Your subclass should override this to set the various field values. send_one_message Delivers the notification, using the Email::Send mailer defined in the "Mailer" and "MailerArgs" configuration arguments. Returns true if mail was actually sent. Note errors are not the only cause of mail not being sent -- for example, the recipients list could be empty. If you wish to send HTML mail, set "html_body". If this is not set (for backwards compatibility) a plain-text email is sent. If "html_body" and "body" are both set, a multipart mail is sent. See Email::MIME::CreateHTML for how this is done. Be aware that if you haven't set "recipients", this will fail silently and return without doing anything useful. set_headers MESSAGE Takes a Email::MIME object "MESSAGE", and modifies it as necessary before sending it out. As the method name implies, this is usually used to add or modify headers. By default, does nothing; this method is meant to be overridden. body [BODY] Gets or sets the body of the notification, as a string. subject [SUBJECT] Gets or sets the subject of the notification, as a string. from [FROM] Gets or sets the from address of the notification, as a string. recipients [RECIPIENT, ...] Gets or sets the addresses of the recipients of the notification, as a list of strings (not a reference). email_from OBJECT Returns the email address from the given object. This defaults to calling an 'email' method on the object. This method will be called by "send" to get email addresses (for "to") out of the list of "recipients". to_list [OBJECT, OBJECT...] Gets or sets the list of objects that the message will be sent to. Each one is sent a separate copy of the email. If passed no parameters, returns the objects that have been set. This also suppresses duplicates. send Sends an individual email to every user in "to_list"; it does this by setting "to" and "recipient" to the first user in "to_list" calling Jifty::Notification's "send" method, and progressing down the list. Additionally, if "to" was set elsewhere, sends an email to that person, as well. to Of the list of users that "to" provided, returns the one which mail is currently being sent to. This is set by the "send" method, such that it is available to all of the methods that Jifty::Notification's "send" method calls. preface Print a header for the message. You want to override this to print a message. Returns the message as a scalar. footer Print a footer for the message. You want to override this to print a message. Returns the message as a scalar. full_body The main, plain-text part of the message. This is the preface, body, and footer joined by newlines. full_html Same as full_body, but with HTML. parts The parts of the message. You want to override this if you want to send multi-part mail. By default, this method returns a single part consisting of the result of calling "$self->full_body". Returns the parts as an array reference. magic_letme_token_for PATH Returns a Jifty::LetMe token which allows the current user to access a path on the site. perl v5.14.2 2011-01-26 Jifty::Notification(3pm)
All times are GMT -4. The time now is 04:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy