Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MIME Header Encoded Email Attachments 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hello,

Is there a way of encoding and attachment into the mime header of an email so you can then reference it from the HTML part of your email via the CID: reference?

I can do this in VBA & Outlook but am having trouble finding how you can do this via PERL.

Thanks,
Craig.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
spot thanks!
Code:
    $msg = MIME::Lite->new(
         To      =>'you@yourhost.com',
         Subject =>'HTML with in-line images!',
         Type    =>'multipart/related'
    );
    $msg->attach(
        Type => 'text/html',
        Data => qq{
            <body>
                Here's <i>my</i> image:
                <img src="cid:myimage.gif">
            </body>
        },
    );
    $msg->attach(
        Type => 'image/gif',
        Id   => 'myimage.gif',
        Path => '/path/to/somefile.gif',
    );
    $msg->send();

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
oops type'o , SPOT ON!!!!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top