Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Mime file 2 mime mail

by nathanvit (Beadle)
on Jan 03, 2005 at 16:09 UTC ( [id://418976]=perlquestion: print w/replies, xml ) Need Help??

nathanvit has asked for the wisdom of the Perl Monks concerning the following question:

Hello to all, i'd like to transform a file which contains text in a readable mail...
This text seems formatted as MIME type.
I'd open it, transform it and send it to someone in a readabel way (in this example it would be "Ciao sono assente!!!")...
I looked at MIME on CPAN and i found MIME::Lite...
Have someone tried MIME::Lite? Is it stable?
I thought to use something like this:
$msg = MIME::Lite->new( From =>$mittente, To =>$destinatario, Subject =>'Ferie', Type =>'image/gif', Encoding =>'base64', Path =>'hellonurse.gif' );
but...
* what have i to put in "Encoding" field?
* What have i to put in "Type" field?
Thanks,
Vittorio

This is the message in the file-->
Vittorio ZuccalĂ <vittorio@pippo.it> This is a multi-part message in MIME format. ------=_NextPart_000_0012_01C4F187.7ACB2870 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Ciao sono assente!!! ------=_NextPart_000_0012_01C4F187.7ACB2870 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2800.1479" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Ciao sono = assente!!!</FONT></DIV></BODY></HTML> ------=_NextPart_000_0012_01C4F187.7ACB2870----> Vittorio ZuccalĂ <vittorio@pippo.it> This is a multi-part message in MIME format. ------=_NextPart_000_0012_01C4F187.7ACB2870 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Ciao sono assente!!! ------=_NextPart_000_0012_01C4F187.7ACB2870 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2800.1479" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Ciao sono = assente!!!</FONT></DIV></BODY></HTML> ------=_NextPart_000_0012_01C4F187.7ACB2870--

Replies are listed 'Best First'.
Re: Mime file 2 mime mail
by Jaap (Curate) on Jan 03, 2005 at 16:20 UTC
    Do you want to SEND the mail from your perl script or do you want to GET the contents of the mime message in a readable way?

    For getting the contents out of the multipart mime message, you could use MIME::Parser.
      >Do you want to SEND the mail from your perl script or
      >do you want to GET the contents of the mime message in a readable way?

      I'd like to send the message in the file in readable way to someone.
      I think the better way is:
      • OPEN the file
      • GET the message
      • PARSE it so it became readable
      • SEND it in readable way
      I do not know if it is the best way to do it so... this is the reason of this mail :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://418976]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-16 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found