Perlseeker_1 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I have data in my array like below

Name ID Salary DOB ABC 01 1000 01-01-1995 ABD 02 2000 01-01-1996 ABE 03 3000 01-01-1994 ABF 04 1000 01-01-1992

I want to send this information in email
by createing a table and inserting same data

Any inputs on this please

Replies are listed 'Best First'.
Re: How can i create an email with table and data in body
by marto (Cardinal) on Jun 26, 2013 at 10:16 UTC

    You can simply send the text by email using MIME::Lite, or create an HTML attachment if you want some other formatting.

      Hi Monks,

      I used MIME:Lite to send an email with attachment

      but i want the same info to be displayed in table

      format in email body

      Any inputs please

        Then send it as the message body, assign your content to Data when constructing the message. The documentation provides examples of sending emails, I suggest you try them.

        Hi there,
        A little FYI: You may want to know that the author of MIME::Lite does not recommend using the module. It is stated in one of the first lines of the documentation on CPAN. I tried to use it before and ended up using MIME::Entity instead..
Re: How can i create an email with table and data in body
by reisinge (Hermit) on Jun 26, 2013 at 11:29 UTC

    I would use Email::MIME as recommended here and pass the table data via body_str key. You can also format the table data as HTML and add content_type => 'text/html', to attributes (see send_mail subroutine here).

    Well done is better than well said. -- Benjamin Franklin

      Do we have any examples perl scripts

      where we can create some tables in email body

      and palce data in those tables and send an email

      I have mutliple rows as my input

      As i am new to this email functionality,any inputs

        Maybe it helps you tackle your problem better if you divide it into separate steps:

        1. Send a text-only mail (using MIME::Lite)
        2. Generate an HTML page as a file with the information you want (using a templating system)
        3. Use MIME::Lite to send the HTML file as the mail body

        From how I understand your current post, it is not clear to me with which part you have problems.