Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Solution

I ended up finding my own solution to this one. Instead of using Mail::Outlook, I decided to use Win32::OLE and configure it to a new outlook application object. I don't know a lot about OLE, but the info. I found about interfacing it with Outlook was very useful: found here.

Basically, that allowed me to set two new message behaviors (objects? parameters?) via the following:

use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; my $outlook = new Win32::OLE('Outlook.Application') or die "Could not +open Outlook Application!\n"; my $msg = $outlook -> CreateItem(0); unless ($msg){ die "Outlook is not running, cannot send mail.\n"; } $msg -> {'To'} = 'addreass@domain.com'; $msg -> {'Subject'} = 'Important Subject Matter'; $msg -> {'BodyFormat'} = 'olFormatHTML'; $msg -> {'HTMLBody'} = 'Some text I want to display <a href=http://goo +gle.com>With Links in HTML</a> embedded in that text\n' $msg -> Send();

So setting the 'BodyFormat' and 'HTMLBody' did the trick.

Original Problem

Howdy All,

So, I'm writing an automatic e-mail notification system for my office. We run Windows 7 and Outlook is the only e-mail program that I am aware of existing on our systems. I've been trying to use the Mail::Outlook module to send my e-mails. The problem is that I can't seem to find a way to insert hyperlinks into the e-mail, that display text other than the url. So if I want to insert a link to Google, I can just post:

$msg -> Body('http://gooogle.com')

However, if I want to link to Google and make it read as, "Search Engine," I'm not sure there's a way to do that. Other mailer modules seem to get around this by formatting the links in HTML. But I don't see a way to format the message as HTML using this module. Does anyone know if there is a way to do that?

If not, does anyone have any suggestions on better e-mail modules for use with a Windows 7 system? (Most of the modules I've found send e-mails using the sendmail folder on Linux boxes. I don't know how to mimic that functionality on Windows boxes).

Cheers,
Brady C. Jackson


In reply to Hyperlinks in Mail::Outlook Module by BJ_Covert_Action

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (6)
    As of 2019-12-11 21:35 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?