05-07-2018
Thanks for the info
.
We were able to get it to work with a similar piece of code using MIME base64 and sendmail.
But we need to know when an email failed because of an invalid address and was not able to figure it out using sendmail. I also tried "-N failure" but still could not get it to work.
When using "mailx -r" we get an email notification when it failed, but the attachment is not sent properly. When we use "sendmail" the attachment works fine but we don't know if the email failed or not.
.
We also tried "mpack" which worked great with the attachments but were not able to get a notification on a failure for an invalid address.
Any suggestions ?
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi there,
i am very new in the unix sector. (i work on HP UX, an Sun Solaris)
i can write some simple scripts,.....
but now i will wirte a script with "mail".
i would like to send a pdf file to a mail recipient.
But if i try it with "mail -s "email@adress" < "filename(with path)" it... (3 Replies)
Discussion started by: scotty
3 Replies
2. Shell Programming and Scripting
Hi,
iam using the following command:
uuencode file1.pdf file1.pdf|mailx - s "waz up?" xyz@domain.com
Iam recieving an encoding error when i try to open the attachment.
Pls help..very urgent!!! (1 Reply)
Discussion started by: Brat
1 Replies
3. Shell Programming and Scripting
hi,
i've created a script that sends out an email using the mailx and uuencode command. the script is ok, but when a 5MB attachment is sent, there are time that the intended recepients does not receive any email. i tested it and the issue is intermitent. please help on how to troubleshoot.
i... (3 Replies)
Discussion started by: tads98
3 Replies
4. AIX
I am using the following command to send PDF attachment with a mail.
uuencode <attachment.pdf> <attachment.pdf>|mailx -s <subject> <mail_id> < <Message_file.txt>
This one send the message with attachment. I would like send PDF attachment with the mail
Can any one help with this issue ?
... (0 Replies)
Discussion started by: sunjup
0 Replies
5. UNIX for Advanced & Expert Users
I have a need to send a file from the unix command line to be sent as an attachment. Is this possible? That is when I open my outlook email I need to file to appear as an attachment.
Also, is there a way to use the mail binary (not mailx) to modify the "reply address". mailx -r works but I need... (1 Reply)
Discussion started by: kieranfoley
1 Replies
6. Shell Programming and Scripting
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. Shell Programming and Scripting
Hi,
Our requirement is to send an attachment and content in a single mail. I am using the below command to send attachement.
---------------------
(uuencode $exp_file $exp_file) |mailx -s "$email_subject" $EmailRecipients
--------------------
I m not able to send any message in the... (4 Replies)
Discussion started by: ashwin3086
4 Replies
8. Shell Programming and Scripting
I am attempting to write a script where I can pass in parameters ( to , from, the location of a pdf attachment ) and send an email that has HTML for the body content and a PDF as an attachment.
I have failed to achieve this with sendmail and mutt. I recently found this.
If there are any... (2 Replies)
Discussion started by: jvsrvcs
2 Replies
9. Shell Programming and Scripting
Hi,
I need to send a attachment which has space in the file name as: "ABC Data Extract.txt" which is present in the location /home/projects/txt
i am using
/home/projects/scripts
mailx -s "Sub" email_id "/home/projects/txt/ABC Data Extract.txt"
but i am not getting the attachment. (7 Replies)
Discussion started by: ATWC
7 Replies
10. UNIX for Dummies Questions & Answers
I am unable to send email with attachment using the mailx command. Without the attachment, the email goes through file.
This is the command I use.
Works : $ echo "Test" | mailx -s "Test" username@website.com
Fails : $echo "Test" | mailx -a all-dss-accounts.txt -s "Test"... (3 Replies)
Discussion started by: nkarthik_mnnit
3 Replies
LEARN ABOUT DEBIAN
log::handler::output::sendmail
Log::Handler::Output::Sendmail(3pm) User Contributed Perl Documentation Log::Handler::Output::Sendmail(3pm)
NAME
Log::Handler::Output::Sendmail - Log messages with sendmail.
SYNOPSIS
use Log::Handler::Output::Sendmail;
my $email = Log::Handler::Output::Sendmail->new(
from => 'bar@foo.example',
to => 'foo@bar.example',
subject => 'your subject',
);
$email->log(message => $message);
DESCRIPTION
With this output module it's possible to log messages via "sendmail".
METHODS
new()
Call "new()" to create a new Log::Handler::Output::Sendmail object.
The following options are possible:
from
The sender address (From).
to The receipient address (To).
cc Carbon Copy (Cc).
bcc Blind Carbon Copy (Bcc)
subject
The subject of the mail.
sender
This option is identical with "sendmail -f".
header
With this options it's possible to set your own header.
my $email = Log::Handler::Output::Sendmail->new(
from => 'bar@foo.example',
to => 'foo@bar.example',
header => 'Content-Type: text/plain; charset= UTF-8',
);
Or
my $email = Log::Handler::Output::Sendmail->new(
header => {
From => 'bar@foo.example',
To => 'foo@bar.example',
Subject => 'my subject',
'Content-Type' => text/plain; charset= UTF-8',
}
);
Or
my $email = Log::Handler::Output::Sendmail->new(
header => [
'From: bar@foo.example',
'To: foo@bar.example',
'Subject: my subject',
'Content-Type: text/plain; charset= UTF-8',
]
);
sendmail
The default is set to "/usr/sbin/sendmail".
params
Parameters for "sendmail".
The default is set to "-t".
maxsize
Set the maximum size of the buffer in bytes.
All messages will be buffered and if "maxsize" is exceeded the buffer is flushed and the messages will be send as email.
The default is set to 1048576 bytes.
Set 0 if you want no buffering and send a mail for each log message.
debug
Set 1 if you want to enable debugging.
The messages can be fetched with $SIG{__WARN__}.
log()
Call "log()" if you want to log a message as email.
$email->log(message => "this message will be mailed");
If you pass the level then its placed into the subject:
$email->log(message => "foo", level => "INFO");
$email->log(message => "bar", level => "ERROR");
$email->log(message => "baz", level => "DEBUG");
The lowest level is used:
Subject: ERROR ...
You can pass the level with "Log::Handler" by setting
message_pattern => '%L'
flush()
Call "flush()" if you want to flush the buffered messages.
validate()
Validate a configuration.
reload()
Reload with a new configuration.
errstr()
This function returns the last error message.
DESTROY
"DESTROY" is defined and called "flush()".
PREREQUISITES
Carp
Params::Validate
EXPORTS
No exports.
REPORT BUGS
Please report all bugs to <jschulz.cpan(at)bloonix.de>.
If you send me a mail then add Log::Handler into the subject.
AUTHOR
Jonny Schulz <jschulz.cpan(at)bloonix.de>.
COPYRIGHT
Copyright (C) 2007-2009 by Jonny Schulz. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-11-21 Log::Handler::Output::Sendmail(3pm)