Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Sending email with both html and plaintext

by CountZero (Bishop)
on Feb 18, 2016 at 21:04 UTC ( [id://1155586]=note: print w/replies, xml ) Need Help??


in reply to Sending email with both html and plaintext

You are using the MIME-type "multipart/alternative" which is used (as per RFC 2046) "for representing the same data in multiple formats". In other words your MIME compliant email reader dutyfully shows you the HTML content (as that is the most "rich" content) and hides the alternative text component.

Did you try "multipart/mixed"?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^2: Sending email with both html and plaintext
by mavericknik (Sexton) on Feb 18, 2016 at 21:16 UTC
    Yes I did try "multipart/mixed". What this does is sends whatever I attach first in the body of the email, and what I attach second as an attachment to the email. So in this example, I get "THIS IS DIRECTLY ATTACHED TEXT" in the body of the email and "THIS IS HTML TEXT" as a seperate .html attachment in the same email. Is there any other type I can try?
      I think that is the expected behaviour: one email with attachments.

      Perhaps you can force your email reader to show the attachment as an email message if the attachment is a proper email message in its own right? I remember that the email reader on my BlackBerry would show all attachemnts that are proper emails indeed as one continuing email and not as a separate attachments.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics
        The problem is the script is suppposed to send out 100's of emails, all to outlook configured the way I have mine set up now. So making changes in outlook does not really solve my problem. I just gave up and am generating a single html code for everything I want to send. Had to make changes to the script but I couldnt figure out another way.
      Add an (additional) empty text before your first attachment?
        But that just makes my email have 2 attachments, I want both in the body not as attachments.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-29 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found