Sponsored Content
Top Forums UNIX for Advanced & Expert Users email attachment, with a message using mailx Post 7445 by edog on Wednesday 26th of September 2001 12:18:25 PM
Old 09-26-2001
email attachment, with a message using mailx

Hi, I am trying to include a message along with an attachment with an email using mailx on AIX.

uuencode Test.dat Test.dat| mailx -s 'Testing' mymail@yahoo.com < MESGFILE

This only gives me the contents of MESGFILE as my message.

If I remove the < FILE I recieve the attachment.

What I want is both the attachent and the message in MESGFILE.

I've checked out the FAQ and I would really like to use mailx so I don't have to wait a month to have my admin install any new tools. Any help/ideas would be appreciated.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract or save attachment of email using mailx

Hi, Could someone help me with 'Extract or save attachment of email using mailx' Thanks, Vijay ;) (1 Reply)
Discussion started by: kandati
1 Replies

2. Shell Programming and Scripting

Sending email with text & attachment using mailx

I spent some time working this out, with a little help from various forums, and thought the community would like to know : Here is how you can send an email from a single Unix command line : /usr/bin/echo "Email text\nNew line\nAnother new line" >x | uuencode sourcefile.txt sourcefile.txt |... (3 Replies)
Discussion started by: haryadoon
3 Replies

3. Shell Programming and Scripting

How to send attachment to web-based email client using mailx

hi, i am trying to send mail with attachment to web-based email client like gmail.com using mailx. the problem is it is displayed in content rather than as attachment. the code i am using is as follows, uuencode test1.txt test1.txt | mailx -s "test only" aaaa@gmail.com does anyone... (1 Reply)
Discussion started by: randomcz1
1 Replies

4. Shell Programming and Scripting

Problem while sending message and attachment with mailx

Hi All, I am trying to send a mail with an attachment and message. Following command I am using. (cat <messagefile> ; uuencode <attachmentfile> <attachmentfile>)|mailx -s"Subject" dave@email.com In the received mail, message body is appearing fine. But attachment is not coming. Rather... (2 Replies)
Discussion started by: nihar.dutta
2 Replies

5. Shell Programming and Scripting

Adding an attachment as an attachment to mailx

I don't want the attachment embedded in the mail. I would like a file attached. When I do mailx -s "Report, `date +'%D %r` " -r "Notifications" bob@bob.com < /usr/local/bin/myreport.log> /dev/null It gets embedded in my email. I want a file attachment. How do I do that? (2 Replies)
Discussion started by: guessingo
2 Replies

6. Shell Programming and Scripting

Mailx: How to send a attachment using mailx command

Hi All, Can anyone please provide the command for sending an mail with attachment using mailx command. Thanks in Advance :) Regards, Siram. (3 Replies)
Discussion started by: Sriram.Vedula53
3 Replies

7. UNIX for Dummies Questions & Answers

Send email with attachment and body : mailx , waiting for input , signal Control D

Hi, I am trying to send email with attacment and body using "mailx" (cat body.txt; uuencode attach.txt) | mailx -s "Attachment" abc@xyz.com When i type this command, the shell is still waiting for me to enter something in standard input and press control D before it sends a mail and... (2 Replies)
Discussion started by: aliaszero
2 Replies

8. Shell Programming and Scripting

Mailx with attachment and message body

i have to attach the 'body in the email' along with attachment below code is throwing errors, how can i do it ? here body file contains message, it should display in email, please help i am using HP-UX (cat body ;) (uuencode attch1 attch1 ;) | mailx -m -s "testing" "abc@gmail.com" ... (4 Replies)
Discussion started by: only4satish
4 Replies

9. UNIX for Dummies Questions & Answers

Mimesender (Perderabo): no attachment in email message

Hello, all, I have been trying to use what Perderabo has given to send attachment via email., but I am not getting the attachments, what I see on the receiving email system are the attachments contents inside the body of the received email. No attachment icon shows in the received email. I am on... (3 Replies)
Discussion started by: gio001
3 Replies

10. Red Hat

Sending email with message body and attachment

Hello experts!! I am trying to send an email with message body and attachment.but i am getting any one like message body or attachment. I tried below command: (echo "subject:test";echo "MIME-Version: 1.0";echo "content-transfer-encoding:base 64";echo "content-type:txt;name=test.txt";cat... (2 Replies)
Discussion started by: Devipriya Ch
2 Replies
Email::Send::Test(3pm)					User Contributed Perl Documentation				    Email::Send::Test(3pm)

NAME
Email::Send::Test - Captures emails sent via Email::Send for testing SYNOPSIS
# Load as normal use Email::Send; use Email::Send::Test; # Always clear the email trap before each test to prevent unexpected # results, and thus spurious test results. Email::Send::Test->clear; ### BEGIN YOUR CODE TO BE TESTED (example follows) my $sender = Email::Send->new({ mailer => 'Test' }); $sender->send( $message ); ### END YOUR CODE TO BE TESTED # Check that the number and type (and content) of mails # matched what you expect. my @emails = Email::Send::Test->emails; is( scalar(@emails), 1, 'Sent 1 email' ); isa_ok( $emails[0], 'Email::MIME' ); # Email::Simple subclasses pass through DESCRIPTION
Email::Send::Test is a driver for use in testing applications that use Email::Send to send email. To be able to use it in testing, you will need some sort of configuration mechanism to specify the delivery method to be used, or some other way that in your testing scripts you can convince your code to use "Test" as the mailer, rather than "Sendmail" or another real mailer. How does it Work Email::Send::Test is a trap for emails. When an email is sent, it adds the emails to an internal array without doing anything at all to them, and returns success to the caller. If your application sends one email, there will be one in the trap. If you send 20, there will be 20, and so on. A typical test will involve doing running some code that should result in an email being sent, and then checking in the trap to see if the code did actually send out the email. If you want you can get the emails out the trap and examine them. If you only care that something got sent you can simply clear the trap and move on to your next test. The Email Trap The email trap is a simple array fills with whatever is sent. When you send an email, it is pushed onto the end of the array. You can access the array directly if you wish, or use the methods provided. METHODS
send $message As for every other Email::Send mailer, "send" takes the message to be sent. However, in our case there are no arguments of any value to us, and so they are ignored. It is worth nothing that we do NOTHING to check or alter the email. For example, if we are passed "undef" it ends up as is in the trap. In this manner, you can see exactly what was sent without any possible tampering on the part of the testing mailer. Of course, this doesn't prevent any tampering by Email::Send itself :) Always returns true. emails The "emails" method is the preferred and recommended method of getting access to the email trap. In list context, returns the content of the trap array as a list. In scalar context, returns the number of items in the trap. clear The "clear" method resets the trap, emptying it. It is recommended you always clear the trap before each test to ensure any existing emails are removed and don't create a spurious test result. Always returns true. deliveries This method returns a list of arrayrefs, one for each call to "send" that has been made. Each arrayref is in the form: [ $mailer, $email, @rest ] The first element is the invocant on which "send" was called. The second is the email that was given to "send". The third is the rest of the arguments given to "send". SUPPORT
All bugs should be filed via the CPAN bug tracker at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Email-Send-Test <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Email-Send-Test> For other issues, or commercial enhancement or support, contact the author. AUTHORS
Current maintainer: Ricardo SIGNES, <rjbs@cpan.org>. Original author: Adam Kennedy <cpan@ali.as>, <http://ali.as/> COPYRIGHT
Copyright (c) 2004 - 2005 Adam Kennedy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.12.4 2011-08-31 Email::Send::Test(3pm)
All times are GMT -4. The time now is 05:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy