in reply to Re: Outlook email with table
in thread Outlook email with table

So I will be able to copy a table from excel? I will take a look at it.

Thanks again..

Paul

Replies are listed 'Best First'.
Re^3: Outlook email with table
by marto (Cardinal) on Jan 24, 2011 at 15:35 UTC

    You mentioned you wanted it to "look nice(same as if I manually copied it from excel and pasted it into an outlook email)", at this point I wasn't sure if Excel was the source or if the 'table' came from somewhere else, for example an HTML table. It helps to be specific when asking a question.

    Regarding reading from Excel see Spreadsheet::ParseExcel, it's similar to Spreadsheet::WriteExcel which I introduced you to previously.

      Yes, Excel would be the source. Thanks for the help! I was able to get that other issues with the other nodes resolved thanks to you. I tried running a test with MIME:Lite. It required me to install all these other packages. Once they were installed I ran into authentication issues. I also installed Authen-SASL but it errored out(no SASL mechanism found at SASL.pm line 77 and SMTP.pm line 143. All I am looking for is a way to be able to copy a row from excel and paste it into an email to send.

      Thanks again,

      Paul

        "I tried running a test with MIME:Lite. It required me to install all these other packages."

        Dependences are common, nothing to worry about.

        "Once they were installed I ran into authentication issues. I also installed Authen-SASL but it errored out(no SASL mechanism found at SASL.pm line 77 and SMTP.pm line 143."

        At this point I'd suggest that you concentrate on the email aspect of your problem first. Can you detail how you installed MIME::Lite and Authen::SASL? Did either produce warnings or errors? Did you skip installing optional modules while installing these? Post the code which causes this error and provide more data like what sort of mail server are you connecting to, a Microsoft Exchange Server? See also SASL.

Re^3: Outlook email with table
by Sinistral (Monsignor) on Jan 24, 2011 at 16:08 UTC

    MIME::Lite is a fairly low level module for creating e-mails that are MIME encoded. That means that, in addition to attachments, you can have the e-mail body be something other than plain text. If you want to send e-mails that are formatted, you're going to want to create an HTML e-mail. This is where you're going to have to do more than simply copy and paste in a MS Office appliction - you're going to need to do the equivalent of pasting your table into something (possibly Word) and save that as HTML. You'll then need to take the HTML table code and put it into the body of your e-mail. You're then going to have to write Perl code that sets the HTML for your e-mail body, for your table, and for any other information that you want in the e-mail. One very good HTML authoring site is SitePoint.com. They have an excellent guide on how to create good e-mail newsletters. Although you're not specifically creating a newsletter, the information still applies, because you're creating an HTML e-mail.

    PS: Even though I mention Word as a possible HTML creator, I only say that because it sounds like you have not written Perl code to generate e-mails before. Word's HTML formatting is complex, verbose, and from an HTML standards perspective quite bad.

      Great information and I think this could be very useful in the future. It sounds like alot of work and steps for what I need to do. Isn't there an easier way to just copy from excel and paste it into an outlook email? Thanks for everyones help. Newbie here still trying to learn.

      Paul
        One way might be to save the spreadsheet (or part of it) as HTML and put that in the email.