Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I have a recent project that requires a potentially large number of emails to be sent out, each with a unique attachment. (A different text body might be nice, but isn't required) Furthermore, the email itself is HTML with embedded images, and to provide more universal email client support, should have a plain text alternate.

A co-worker and I have spent some time looking through the various perl modules, but we have yet to be able to get one to support all of the above in one email. Netscape 4 seems to be able to send mail that is compatible with just about everything, so we have been using its output as a guideline. I've cleaned it up a little, indented it, and included it at the bottom here.

Mail-Sender apparently either does images/HTML or attachments but not both, (no nesting) MIME-Lite, and MIME-Lite-HTML both looked promising, but a few hours of poking still couldn't get the message formatting the same as that Netscape used.

My co-worker has found a PHP solution which we will be using, but it irks me that we couldn't get it working with Perl. Has anyone encountered a need similar to this? Is it just my inability to get the module working properly? I have a feeling more email-tasks will be coming along in the near future, and I'd like to be ready.

<header stuff> Subject: test Content-Type: multipart/mixed; boundary="------------C5E2B1FC8FFADB6068E11254" X-UIDL: p&+!!8",!!(o4"!Q!]"! This is a multi-part message in MIME format. --------------C5E2B1FC8FFADB6068E11254 Content-Type: multipart/alternative; boundary="------------172AC1BCD76027479338C05A" --------------172AC1BCD76027479338C05A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit [Image] hi --------------172AC1BCD76027479338C05A Content-Type: multipart/related; boundary="------------C08FD7D2A292CEFA0E9B210D" --------------C08FD7D2A292CEFA0E9B210D Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!doctype html public "-//w3c//dtd html 4.0 transitional// +en"> <html> <img SRC="cid:<file>" height=75 width=442> <p>hi</html> --------------C08FD7D2A292CEFA0E9B210D Content-Type: image/gif Content-ID: <file> Content-Transfer-Encoding: base64 Content-Disposition: inline; <filename> <DATA> --------------C08FD7D2A292CEFA0E9B210D-- --------------172AC1BCD76027479338C05A-- --------------C5E2B1FC8FFADB6068E11254 Content-Type: application/pdf; name="cert-noname.pdf" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="cert-noname.pdf" <DATA> --------------C5E2B1FC8FFADB6068E11254--

In reply to Sending HTML email w/images + attachment by Xaositect

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found