Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Multipart/Alternative

by Anonymous Monk
on Feb 11, 2003 at 15:12 UTC ( [id://234413]=perlquestion: print w/replies, xml ) Need Help??

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

I am having trouble sending mutipart/alternative messages through perl using the code below. Are there rrors in this code? Am I missing something? Thanks in advance.
print MAIL "To: $config->{email_to}\n"; print MAIL "From: $config->{email_from}\n"; print MAIL "Subject: $config->{email_subject}\n"; print MAIL "Content-Type: multipart/alternative; boundary=zzz\n\n"; print MAIL qq^ --zzz Content-Type: text/plain $config->{email_comment} Read the full story at:\n$config->{url} --zzz Content-Type: text/html $UrlHtmlData --zzz--

Replies are listed 'Best First'.
Re: Multipart/Alternative
by Abigail-II (Bishop) on Feb 11, 2003 at 15:37 UTC
    Assuming there's a closing ^ somewhere, I don't see any Perl errors in the code. After all, all you have are print statements.

    I'd prefer to use a single here doc, but that's another issue.

    Now, whether you are using the correct MIME format, I don't know. I presume that if you aren't using a module for it, you know the MIME format better than I do.

    Abigail
    -- 
    What has happened to the times when email was plain text, and nothing more than plain text?

Re: Multipart/Alternative
by extremely (Priest) on Feb 11, 2003 at 15:50 UTC
    You'd be a lot happier in life if you'd just grab the MailTools package. (try MIME::Entity especially.)

    --
    $you = new YOU;
    honk() if $you->love(perl)

Re: Multipart/Alternative
by extremely (Priest) on Feb 11, 2003 at 16:03 UTC
    Oh, and to actually answer your non-perl question :), I think you need to doublequote the boundary string in the header. And I'm darn certain that "===" isn't a good idea for a string.

    If I were you, I'd make it a _lot_ uglier.

    --
    $you = new YOU;
    honk() if $you->love(perl)

Re: Multipart/Alternative
by Jenda (Abbot) on Feb 11, 2003 at 20:48 UTC
    use Mail::Sender;

    I'm not gonna copy the example from the module into here. The link above will take you directly to the code.

    HTH, Jenda

Log In?
Username:
Password:

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

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

    No recent polls found