Hi,

A mass email to all employees, users click on the picture, page jump.But,the web page of my mail system, local image cannot be inserted in the text, can only be inserted from the network.

I try to use the mail::sender,however,in my mail web page,the image from local cannot show.How to do? Can help change the code?

Thanks.

use strict; use Mail::Sender; eval; eval { (new Mail::Sender) ->OpenMultipart({ smtp=> 'smtp.domain.com', from=>'user@domain.com', auth=>'LOGIN', authid=>'perl', authpwd=> 'password', debug=>'./perllog', to => \@mail_address, subject => 'page JUMP', multipart => 'related', }) ->Part({ctype => 'multipart/alternative'}) ->Part({ctype => 'text/html', disposition => 'NONE', msg => << +'*END*'}) <html><body> <A href="http://xxx/xxx" title="image"><div align=center><img align=ce +nter src="cid:img1" title="image" alt="image" /></div></A> </body></html> *END* ->EndPart("multipart/alternative") ->Attach({ description => 'perl\'s jpg', ctype => 'image/jpeg', encoding => 'base64', disposition => "inline; filename=\"image.jpg\" +;\r\nContent-ID: <img1>", file => 'image.jpg'}) #local_image , can't se +em to replace the network_image? ->Close(); } or print "Error sending mail: $Mail::Sender::Error\n";

In reply to How mail::sender send a image(HTML hyperlink) from network? by perllee

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, details, 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, summary, 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.