I am trying to send the contents of a file as email body. I am using html email and sendmail option of unix. I am using the below piece of code for the same :
But the output i am getting is :
The output i require is :
The file_test.txt looks like:
Please help me in formatting the email body !
Last edited by rockygsd; 12-31-2013 at 01:16 AM..
Reason: Data protect
Hi folks,
I have a perl script which sends out email after successful completion of job as inline html, I want to send it out as two parts now as html inline and html attachment. see the attached script.
Thanks in advance (1 Reply)
I have a html file:
# cat sample.html
<html>
<body>
Sample HTML file</p>
</body>
</html>
And I have two excel sheets (sheet1.xls & sheet2.xls)
I want to send an email by having the sample.html as the message body and two spreadsheets as the attachments.
I tried using the below command:... (12 Replies)
I have an HTML file I am currently sending in the body of an email. I now have a need to send a csv attachment along with it. I can ONLY use sendmail as mutt and xmail etc are not on the server.
Here is what I am currently using: It is possible to add code to add an attachment ??!?
{
... (8 Replies)
Hello,
I need help with my script that will send email via sendmail command that will shows both the header and footer logo once the recepient receive the email (e.g. MS Outlook). When I tested to ran the script it will successfully send the email BUT UNFORTUNATELY it doesn't displayed the... (8 Replies)
when I try to read a file and send email using cat and sendmail: The email received having additional spaces.(Between the letters of words in the text)
My code:
export MAILTO="sa@y.com"
export SUBJECT="mydomain PREPROD MONITOR AT ${DATE}"
export... (5 Replies)
Hi All,
Can anyone help with an email formatting question:
Im using the following example to try and send a formatted email:
outputFile="file.txt"
(
echo "From: oracle@inovis.com"
echo "To: john.dickinson@gxs.com"
echo "MIME-Version: 1.0"
echo "Subject: Test Font"
echo... (4 Replies)
Hi,
I was working on getting an HTML file in the mail body along with attaching a "csv" file to the mail.
Below are the 2 parts of the code.
I need help with the second part where I'm sending the mail. The HTML file as an attachment is perfect without any issues and with proper formatting.... (6 Replies)
I am using Sun Solaris ver. 5.10 and trying to send an HTML table in email body using mail command in C shell script.
I tried following commands:-
#1
mail -m "MIME-Version: 1.0;Content-type:text/html;charset=UTF-8" receiver@mail.com < file.html #2
mail -m "Content-type: text/html;" -s "This... (4 Replies)
Hi,
I am having trouble in sending a mail with html body and attachment (csv file). We don't have uuencode or mutt (not allowed to install as well)
The below code is perfectly working for sending the html body alone:
export MAILTO=abc@xyz.com
export CONTENT="/home/abc/list.html"... (2 Replies)
Hello All,
I have a query here. I am sending an HTML table(which I am creating it by a call to REST API, in a LINUX box) and from there I have to send it into an email. So following are the poins on same:
As data is not static so it is writing Dynamic data and creating HTML file.
There is... (9 Replies)
Discussion started by: RavinderSingh13
9 Replies
LEARN ABOUT DEBIAN
email::abstract
Email::Abstract(3pm) User Contributed Perl Documentation Email::Abstract(3pm)NAME
Email::Abstract - unified interface to mail representations
SYNOPSIS
my $message = Mail::Message->read($rfc822)
|| Email::Simple->new($rfc822)
|| Mail::Internet->new([split /
/, $rfc822])
|| ...
|| $rfc822;
my $email = Email::Abstract->new($message);
my $subject = $email->get_header("Subject");
$email->set_header(Subject => "My new subject");
my $body = $email->get_body;
$rfc822 = $email->as_string;
my $mail_message = $email->cast("Mail::Message");
DESCRIPTION
"Email::Abstract" provides module writers with the ability to write simple, representation-independent mail handling code. For instance, in
the cases of "Mail::Thread" or "Mail::ListDetector", a key part of the code involves reading the headers from a mail object. Where
previously one would either have to specify the mail class required, or to build a new object from scratch, "Email::Abstract" can be used
to perform certain simple operations on an object regardless of its underlying representation.
"Email::Abstract" currently supports "Mail::Internet", "MIME::Entity", "Mail::Message", "Email::Simple" and "Email::MIME". Other
representations are encouraged to create their own "Email::Abstract::*" class by copying "Email::Abstract::EmailSimple". All modules
installed under the "Email::Abstract" hierarchy will be automatically picked up and used.
METHODS
All of these methods may be called either as object methods or as class methods. When called as class methods, the email object (of any
class supported by Email::Abstract) must be prepended to the list of arguments, like so:
my $return = Email::Abstract->method($message, @args);
This is provided primarily for backwards compatibility.
new
my $email = Email::Abstract->new($message);
Given a message, either as a string or as an object for which an adapter is installed, this method will return a Email::Abstract object
wrapping the message.
If the message is given as a string, it will be used to construct an object, which will then be wrapped.
get_header
my $header = $email->get_header($header_name);
my @headers = $email->get_header($header_name);
This returns the values for the given header. In scalar context, it returns the first value.
set_header
$email->set_header($header => @values);
This sets the $header header to the given one or more values.
get_body
my $body = $email->get_body;
This returns the body as a string.
set_body
$email->set_body($string);
This changes the body of the email to the given string.
WARNING! You probably don't want to call this method, despite what you may think. Email message bodies are complicated, and rely on
things like content type, encoding, and various MIME requirements. If you call "set_body" on a message more complicated than a single-part
seven-bit plain-text message, you are likely to break something. If you need to do this sort of thing, you should probably use a specific
message class from end to end.
This method is left in place for backwards compatibility.
as_string
my $string = $email->as_string;
This returns the whole email as a decoded string.
cast
my $mime_entity = $email->cast('MIME::Entity');
This method will convert a message from one message class to another. It will throw an exception if no adapter for the target class is
known, or if the adapter does not provide a "construct" method.
object
my $message = $email->object;
This method returns the message object wrapped by Email::Abstract. If called as a class method, it returns false.
Note that, because strings are converted to message objects before wrapping, this method will return an object when the Email::Abstract was
constructed from a string.
PERL EMAIL PROJECT
This module is maintained by the Perl Email Project
<http://emailproject.perl.org/wiki/Email::Abstract>
AUTHOR
Casey West, <casey@geeknest.com>
Simon Cozens, <simon@cpan.org>
Ricardo SIGNES, <rjbs@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2004 by Simon Cozens
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2011-02-18 Email::Abstract(3pm)