Plain-text parser

Hi everybody
The project I've been working on involves parsing plain-text, structured messages. These messages contain records of fixed length, and of several different types. Some of these record types have data & behaviour in common, so that it feels quite natural AND good practice to use inheritance
to illustrate this, here's (roughly) the grammar of my messages :
Message => MessageHeader Invoice* MessageFooter
Invoice => InvoiceHeader Record* InvoiceFooter
Record => RecordX | RecordY | RecordZas I said, RecordX, RecordY and RecordZ have data & behaviour in common (same applies for MessageHeader/Footer and InvoiceHeader/Footer) and are composed of many fields of different types
The first treatment I want to apply is to parse such messages from the filesystem and construct a graph of objects (in order to save it to DB afterwards via hibernate)
How would you organise a suitable and proper-OO parser package in order to minimize code redundancy, allow TDD... I have already written dozens of solutions, none satisfies me 100%...
If you want further info / description / excerpts of my precedent solutions, no problem ! I don't want to be TOO specific, since I have the feeling that there's some kind of generic pattern that could apply to this problem elegantly... Am I wrong ?

Parsing is seperate from the graph.sure ok about that
So what exactly do you think needs improvement?I don't like these long parse(InputStream) methods
that just call some "basic parser" (implementing
methods like parse, parseInt, parseShort, and so on)
again and again, especially when a lot of parsing
activity code is duplicated (same sub-sequences of
fields in records of different types)
It gives you something like that :
public RecordX parse(InputStream inputStream) {
....I don't see a problem.
You can generalizing it using a decription component if you wish.
But, speaking from experience, unless you have a lot of these which are very similar then doing so it makes it harder to maintain (due to special cases.) And it doesn't make it faster.
>
>>
And "many fields" doesn't say much. In particular
just because an attribute exists or doesn't exist
does not necessarily imply that inheritance is
needed. For example I am still a human whether I
have a job or not.what I meant is : some records of different types
have many attributes and the most part of behaviour
in common so parsing them in separate classes
(specialised parsers) induces lengthy methods and
lots of duplicate code... This couldn't possibly
scale if there were many more types of records (I
feel I'm deserving a good "YAGNI" here ;-))
I suspect that you look at something like the following two snippets and see 'duplicate' code (pseudo representation of what you are doing.)
         fieldx1 = parse.parseInt(5)
         parse.skip(3)
         fieldx2 = parse.parseInt(7)
         fieldy1 = parse.parseInt(5)
         parse.skip(3)
         fieldy2 = parse.parseInt(4)
         fieldy3 = parse.parseInt(7)
There are similarities in the above but they are not duplicate.
And you could create a routine that handles both but there are so many dissimilarities between them that the duplicate part would become obscure by the part that isn't similar.
roughly, when I'm looking at the parser module of the
project and the classes involved, I can't help the
feeling there's something wrong :
It isn't quick and easy but learning how to generate code makes the production of such code a lot easier.
Instead of writing code you would produce something like this....
       fieldx1 int 5
       skip 3
       fieldx2 int 7
This would then be fed to a generator which then produces the appropriate code.
Various ways exist to do this...
- JavaCC
- XDoclet
- roll your own
And there are probably others (pretty sure there are alternatives to JavaCC.)
However whether this "helps" depends on what is being parsed. (Although for myself I find it more interesting to generate code even if it takes me as long to do it as if I did it manually.)
This couldn't possibly scale if there were many more types of recordsDon't strive to build code that meets all possibilities. Strive to build code that meets the current requirements and which meets the known future possibilities. (Known is a tentative term and isn't limited to just requirements in hand but can be based on a comment from someone that suggests something like this might be needed in the future.)
Having built systems that parse various structures I find it unlikely that additions in the future are going to easily fit a current model. Many times they are completely different.

Similar Messages

  • DECODING MAIL FROM WEB SERVER IN PLAIN TEXT FORMAT(THE MAIL BEING SENT BY LABVIEW APPLICATION)

    Hi All
    I have a labview application that send mail every hour automatically.
    But actually the mail has to be decoded from the web server(by another application).But now when that application decode the data in the mail(that is send by labview application)its getting some funny characters inside that can not be detected by the decoding application
    (When open the mail no problem.)But actually our goal is to decode the mail from the web server.
    Why the extra characters are appearing when decoding from the server?Is it because of the HTML format?
    Is there option to send the mail in plain text format(not like attachment)?
    In outlook we can change the setting (tools->options->send->mail sending format->....here we can set as HTML format/Plain Text format)
    Like that at the sending time can i chenge the sending option as plain text format in my labview application?
    Thanks...

    smercurio_fc wrote:
    Then it sounds to me like this other application is not decoding the attachment correctly, especially if you looked at the attachment yourself after you received it and verified it's correct.
    No, no, smercurio. This is charcter encoding here. In older versions of LabVIEW you could specify what character encoding to use when sending an email through the SMTP VIs. But that gave problems since people in certain locales used certain characters that where not transfered right when the wrong encoding was specified, and that encoding stuff is not understood by most people at all, so the wrong selected encoding was rather the rule than the exception. In newer versions of LabVIEW do the SMTP VIs handle the encoding automatically based on the currently used locale on the system.
    This change is documented in the Upgrade Notes of LabVIEW and probably happened around LabVIEW 7.1 or 8.0.
    A decent mail client will recognize the encoding and convert it back to whatever is necessary before presenting it to the user. The OPs posters server application obviously isn't a smart mail client but probably just some crude text file parser that has no notion of proper mail character encoding and how to deal with it.
    I would suppose that there is a chance to dig into the SMTP VIs itself and try to manipulate or disable that encoding altogether in there but that may open a whole can of worms somewhere else. The proper way would be to process the incoming mail by a character encoding aware mail client before passing it to the text parser. On Unix setting up something like this would be fairly trivial.
    Rolf Kalbermatter
    Message Edited by rolfk on 01-23-2008 10:21 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Plain Text URL links not working in the Windows 8 Mail App for only one account.

    Hello,
    I just started using a Surface Pro, and randomly one of the accounts I have setup in the "Modern" Mail app stopped parsing the pain text URL path that was included in them.  Specifically links to forum discussions.  I have 4 other Win
    8 devices and they display the links fine.
    More confusing is this issue happens ONLY with my O365 mail account and only on one PC.   I have an Outlook.com account and it renders the pain text URL as a clickable link, but when I send the same email to my O365 account it just shows up as
    text, no link generated.  All in the same Windows 8 Mail App.
    I ran the Windows 8 App Troubleshooter, I've reinstalled the Mail app,  I've removed and re-added the mail account.  Nothing fixes this.  Anyone know why?
    Thanks,
    Joe

    Same problem for us, the link is also not rendered, if the mail is sent to an on-premise Exchange server.
    Its only for plain-text messags, HTML-messages work fine.
    Why is this problem ignored? The app is useless with that limitation.

  • KNOWN ISSUE: HTML Messages with plain-text signatures

    To get around the EAS security policy issue, I'm having non-sensitive emails from work forwarded to a GMail account from a redirect set up in our corporate OWA. The redirect seems to send the messages to GMail without any issues; formatting is 100% intact, and in the GMail web client as well as Thunderbird, Entourage, etc., HTML emails with plain-text signature attachments show the plain-text message inline with the rest of the formatted message. All of our internal mailing lists have these plain text attachments that say where the message was coming from (Message sent from [email protected] by listserv). These get affixed to every message, both plain text and HTML.
    Here's my problem: The Pre's email client handles both plain text and HTML messages beautifully. But, when I receive a message from a mailing list with a plain text attachment, the HTML portion disappears, and all I see is the signature.
    Is there any way to make the Pre show the HTML INSTEAD of the plain text? I can live without the sig, I know where the messages are coming from already. But if I can't read the message, it's useless. I've only begun researching this and so far Google hasn't been much help, nor has searching these or other forums. Any help would be appreciated.
    Palm Pre P100EWW
    Post relates to: Pre p100eww (Sprint)
    Message Edited by HowellBP on 06-16-2009 04:13 PM

    1-51626418773
    I just got off the phone with Palm Support. Apparently this is a bug in the mail application. It currently does not support parsing both HTML and plain text in the same message. It will read EITHER plain text OR HTML, but not both at the same time. This will be fixed in a future update.

  • How to Improve Design for HTML, Plain Text and Multiple Recipients?

    Hello there,
    JavaMail programming is so fun! I first start off mixing the JavaMail code inside a servlet and then refactored it to two separate classes.
    Mailer is the independent class which uses JNDI to look up config parameters, sends e-mails, and then closes the connection with the protocol.
    public class Mailer {
         private Session mailSession;
         protected void sendMsg(String email, String subject, String body)
         throws MessagingException, NamingException {
              Properties props = new Properties();
              InitialContext ictx = new InitialContext(props);
              Session mailSession = (Session) ictx.lookup("java:/Mail");
              String username = (String) props.get("mail.smtps.user");
              String password = (String) props.get("mail.smtps.password");
              MimeMessage message = new MimeMessage(mailSession);
              message.setSubject(subject);
              message.setRecipients(javax.mail.Message.RecipientType.TO,
                        javax.mail.internet.InternetAddress.parse(email, false));
              message.setText(body);
              message.saveChanges();
              Transport transport = mailSession.getTransport("smtps");
              try {
                   transport.connect(username, password);
                   transport.sendMessage(message, message.getAllRecipients());
                   Logger.getLogger(this.getClass()).warn("Message sent");
              finally {
                   transport.close();
    }MailController is just a simple Java servlet where a Mailer object is instantiated and a String is passed inside the Mailer.sendMsg() method.
    public class MailController extends HttpServlet {
         /** static final HTML setting for content type */
         private static final String HTML = "text/html";
         myapp/** static final HTML setting for content type */
         private static final String PLAIN = "text/plain";
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
              doPost(request, response);
         public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
              response.setContentType(PLAIN);
              PrintWriter out = response.getWriter();
              String mailToken = TokenUtil.getEncryptedKey();
              String body = "Hello there, " + "\n\n"
                        + "Wanna play a game of golf?" + "\n\n"
                     + "Please confirm: https://localhost:8443/myapp/confirm?token="
                     + mailToken + "\n\n" + "-Golf USA";
              Mailer mailer = new Mailer();
              try {
                   mailer.sendMsg("[email protected]", "Golf Invitation!", body);
                   out.println("Message Sent");
              catch (MessagingException e) {
                   e.printStackTrace();
              catch (NamingException e) {
                   e.printStackTrace();
    }Have some design issues...
    If you can notice, I manually place the body of the e-mail (as a String) from inside the client (in this case, a Java Servlet). Also, I manually have to switch the content type inside the doPost().
    Question(s):
    (1) How can the Mailer class be set up, so it can send both HTML and plain text messages?
    (2) How can the Mailer class be structured to send e-mail to multiple recipients or one user?
    (3) Would both of these features / actions require writing two overloaded methods for sendMsg()?
    Would appreciate it if someone could help me...
    Happy programming,
    Michael

    Okay, I came up with this single method:
    Mailer.java:
    public class Mailer
         private Session mailSession;
         protected void sendMessage(String email, String recipient, String subject,
                   String plainText, String htmlText)
            throws MessagingException, NamingException
              Properties props = new Properties();
              InitialContext ictx = new InitialContext(props);
              Session mailSession = (Session) ictx.lookup("java:/Mail");
              String username = (String) props.get("mail.smtps.user");
              String password = (String) props.get("mail.smtps.password");
              MimeMessage message = new MimeMessage(mailSession);
              InternetAddress from = new InternetAddress(email);
              InternetAddress to = new InternetAddress(recipient);
              message.setSubject(subject);
              message.setFrom(from);
              message.addRecipient(Message.RecipientType.TO, to);
              Multipart multipart = new MimeMultipart();
              BodyPart messageBodyPart = new MimeBodyPart();
              messageBodyPart.setText(plainText);
              multipart.addBodyPart(messageBodyPart);
              messageBodyPart = new MimeBodyPart();
              messageBodyPart.setContent(htmlText, "text/html");
              multipart.addBodyPart(messageBodyPart);
              message.setContent(multipart);
              Transport transport = mailSession.getTransport("smtps");
              try {
                   transport.connect(username, password);
                   transport.sendMessage(message, message.getAllRecipients());
                   Logger.getLogger(this.getClass()).info("Message sent");
              catch (Throwable t) {
                   Logger.getLogger(this.getClass()).error("Unable to Send Message");
                   t.printStackTrace();
              finally {
                   transport.close();
    }Created a MailController class to instantiate and run the Mailer class.
    public class MailController extends HttpServlet {
         // doPost() method()
         public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
              response.setContentType(PLAIN);
              PrintWriter out = response.getWriter();
              String mailToken = TokenUtil.getEncryptedKey();
              String plainText = "Hello there, " + "\n\n"
                        + "I wanna invite you to a game of golf!" + "\n\n"
         + "Please confirm: https://localhost:8443/myapp/confirm?token="
                        + mailToken + "\n\n" + "-Golf USA";
              String htmlText = "<H1>Golfer Challenge!</H1>";
              Mailer mailer = new Mailer();
              try {
                   String from = "[email protected]";
                   String recipient = "[email protected]";
                   String subject = "Golf Challenge";
                   mailer.sendMessage(from, recipient, subject, plainText, htmlText);
                   Logger.getLogger(
                               this.getClass()).info("Message Sent to: " + recipient
                                                              + " from: " + email);
                   out.println("Message Sent to: " +
                                             recipient + "\n" + " from: " + email);
              catch (MessagingException e) {
                   e.printStackTrace();
              catch (NamingException e) {
                   e.printStackTrace();
    }Question(s):
    (1) How come the Multipart Alternative only supports HTML for the second part? Can I specify it to send HTML first and plainText second?
    (2) How would I send in multiple recipients? Would I have to pass in an array reference (surrounded by a for loop) inside sendMessage() as follows:
    mailer.sendMessage(from, myArray, subject, plainText, htmlText);
    Thank you for all of your help!
    -Michael                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Show plain text in IIS..

    Hi, I'm a novice in JWS..
    I'm testing Java Web Start in IIS (windows 2000 server)..
    After needing MIME type as inputing
    "application/x-java-jnlp-file" with file type "jnlp"..
    Explorer show the plain text of jnlp files...
    what's wrong with it??
    What's need to set up Java Web start Server???
    (Maybe server need to set XML parsing???)
    In my case, I set up my server with only MIME type in IIS...
    Thanks to reading.. ugly writing... ^^
    I hope your help...
    [email protected]

    You may need a restart.
    I am using it with win2k and apache, and once I restarted apache that problem went away.

  • How to conver HTML text to plain text?

    If I am lucky, I hope to get some real good answers. Basically, I have an HTML file saved on my hard drive, and I want to convert that HTML file to a plain text file.
    I tried implementing something myself. My algorithm was to simply match "<" and ">" and get rid of anything in between. It's working fine, but it's not fully cooked. It doesn't get rid of some weird characters like &XXXX, which is supposed to be some sort of a code for HTML. Also, it doesn't remove JavaScript codes or anything that's not contained in <BODY>...</BODY>. I sure can improve my program, but I am also hoping to see a faster and more efficient way to deal with that.
    I browsed thru some old topics, but nothing was satisfactory. Someone suggested the use of JEditorPane:
    int len = pane.getDocument().getLength();
    try {
    String text = pane.getDocument().getText(0,len);
    System.out.println(text);
    } catch (Exception e) {
    System.exit(0);
    But the problem with that is how a JEditorPane object should be instantiated. I could do something like this JEditorPane pane = new JeditorPane (URL url) or JEditorPane pane = new JeditorPane (String url). Either way, the program takes time to download the HTML page from the corresponding url. If one tries to detect �int len�, one can see that �int len� is likely to be zero, because the HTML page cannot be fully loaded in time. I guess I could try to deal with that problem by creating threads and stuffs. But I hope that there are some better solutions to end this misery once and for all.

    Here is a link to an article on the "Swing HTML Parser":
    http://java.sun.com/products/jfc/tsc/articles/bookmarks/index.html
    This is an example of how you might use the parser callback to solve your problem:
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.Reader;
    import javax.swing.text.MutableAttributeSet;
    import javax.swing.text.html.HTML;
    import javax.swing.text.html.HTMLEditorKit;
    import javax.swing.text.html.parser.ParserDelegator;
    public class TestParser extends HTMLEditorKit.ParserCallback
         boolean ignoreText;
         public static void main(String[] args)
         throws IOException
              TestParser parser = new TestParser();
              // args[0] is the file to parse
              Reader reader = new FileReader(args[0]);
              try
                   new ParserDelegator().parse(reader, parser, false);
              catch (IOException e)
                   System.out.println(e);
         public void handleComment(char[] data, int pos)
    //          System.out.println(data);
         public void handleEndOfLineString(String eol)
         public void handleEndTag(HTML.Tag tag, int pos)
    //          System.out.println("/" + tag);
              if (tag.equals(HTML.Tag.STYLE)
              ||  tag.equals(HTML.Tag.SCRIPT) )
                   ignoreText = false;
         public void handleError(String errorMsg, int pos)
    //          System.out.println(pos + ":" + errorMsg);
         public void handleMutableTag(HTML.Tag tag, MutableAttributeSet a, int pos)
    //          System.out.println("mutable:" + tag + ": " + pos + ": " + a);
         public void handleSimpleTag(HTML.Tag tag, MutableAttributeSet a, int pos)
    //          System.out.println( tag + ":" + a );
         public void handleStartTag(HTML.Tag tag, MutableAttributeSet a, int pos)
    //          System.out.println( tag + ":" + a );
              if (tag.equals(HTML.Tag.STYLE)
              ||  tag.equals(HTML.Tag.SCRIPT) )
                   ignoreText = true;
         public void handleText(char[] data, int pos)
              if (! ignoreText)
                   System.out.println( data );
    }

  • RTF Text - PLain Text

    Can I use the swing.text.rtf library to convert RTF text into plain text? If so, what's a quick way to do so? What I need to do is parse some given string of RTF code to see if there is any actual text inside (other than just RTF commands)
    I wanted to use PDFFilter as referenced in PDFParser but apparently that class does not exist

    sorry for resing the topic but I have almost exact same problem. However when I tested this solution it doesnt seem to work so I figured you may tell me what am I doing wrong. I have the following code
    import java.io.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.text.rtf.*;
    public class rtf2text {
      public static void main(String args[]) {
        try {
             StringReader sr = new StringReader("{\\lang1033\\langfe1049\\langnp1033  text \\par \\par \\par Some table \\par \\par \\par}");
          JEditorPane editor = new JEditorPane();
          RTFEditorKit kit = new RTFEditorKit();
          editor.setEditorKit(kit);
          javax.swing.text.Document doc = editor.getDocument();
          kit.read(sr, doc, 0);
          String s = doc.getText(0, doc.getLength());
          System.out.println("sAttachment\n >" + s + "<");
        catch (Exception ex) {
          ex.printStackTrace();
    }and it doesnt return anything i.e. s="". What am doing wrong?

  • How do I decode UTF-8 hexadecimal numbers into plain text?

    I have a string of numbers like these: 36 36 30 31 .... 6f
    I would like to know which is the best way to go about decoding those values into plain text. Thank you.

    Split the String to create an array;
    For each String in the array, parse it using http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#parseInt(java.lang.String,%20int)
    Create a new String using: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#String(byte[],%20java.lang.String)

  • Text parsing and java

    I'd like to develop a java application that takes an .html plain text file and finds an html table within the file, and puts that table into a jtable (formatting it according to my preferences). I'm assuming a text parser would be my best bet. I can build my own text parser, but I'd like to avoid the work if there's an efficient parser in the API. Is there?

    These examples from [url http://javaalmanac.com/egs/javax.swing.text.html/pkg.html]Java Developers Almanac might help you out.

  • HT5361 Tools Options Mail format Plain text options Set you characters to 130 Click ok

    How do I goto out look to change mail format

    smercurio_fc wrote:
    Then it sounds to me like this other application is not decoding the attachment correctly, especially if you looked at the attachment yourself after you received it and verified it's correct.
    No, no, smercurio. This is charcter encoding here. In older versions of LabVIEW you could specify what character encoding to use when sending an email through the SMTP VIs. But that gave problems since people in certain locales used certain characters that where not transfered right when the wrong encoding was specified, and that encoding stuff is not understood by most people at all, so the wrong selected encoding was rather the rule than the exception. In newer versions of LabVIEW do the SMTP VIs handle the encoding automatically based on the currently used locale on the system.
    This change is documented in the Upgrade Notes of LabVIEW and probably happened around LabVIEW 7.1 or 8.0.
    A decent mail client will recognize the encoding and convert it back to whatever is necessary before presenting it to the user. The OPs posters server application obviously isn't a smart mail client but probably just some crude text file parser that has no notion of proper mail character encoding and how to deal with it.
    I would suppose that there is a chance to dig into the SMTP VIs itself and try to manipulate or disable that encoding altogether in there but that may open a whole can of worms somewhere else. The proper way would be to process the incoming mail by a character encoding aware mail client before passing it to the text parser. On Unix setting up something like this would be fairly trivial.
    Rolf Kalbermatter
    Message Edited by rolfk on 01-23-2008 10:21 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Unable to change font color for Plain Text Emails

    I have a Win7 Enterprise x86 machine running Outlook 2010.  I am unable to read plain text emails.  When I go into Options->Mail->Stationary and Fonts, the preview box under "Composing and reading plain text messages" is all white. 
    I've tried changing it to automatic, black, random colors, different fonts and styles, click 'Ok' and nothing happens.  Preview pane and incoming plain text emails are white.  I followed all the steps in this TechNet article: http://social.technet.microsoft.com/Forums/office/en-US/0e535f1f-0a2f-4208-9b05-42c4e943b484/outlook-2010-cannot-view-plain-text-emails?forum=officeitproprevious
    Applied the Fix It, repaired Office 2010, renamed the normalemail.dotm file.  Still nothing.
    Anyone run into this issue or have a fix?

    This could be a view issue. Please try to open Outlook using the /cleanviews
    switch to clean your views, and try again. Here is the line switches for Outlook 2010http://office.microsoft.com/en-001/outlook-help/command-line-switches-for-outlook-2010-HP010354956.aspx
    If /cleanviews doesn't work for you, you might try to recreate your Outlook profile. Please refer to this article:
    http://office.microsoft.com/en-us/outlook-help/create-an-outlook-profile-HA102749460.aspx
      

  • Different rich text/plain text settings for different accounts?

    I use Mail for both my work email (MS Exchange) and my personal email (webmail/IMAP). Many of my coworkers use Outlook's rich text formatting options, so I need to have my work emails go out as rich text. However I'd like to have my personal emails go out as plain text.
    I can set Mail to create new messages in plain text, but to reply in the same format of the original message. That takes care of everything EXCEPT when I compose a new message using my work address... in that case it goes out as plain text, and my coworkers complain that they can't use formatting, because their copies of Outlook are in turn configured to reply in the same format as the original message.
    So ideally what I'd like is to have two different formatting settings for my two different accounts. Anyone know how this might be done? Any plugins, etc., that might accomplish this?

    Since you are running Jaguar, Jaguar and Panther Mail do not support composing in HTML and this includes when forwarding a message received that was composed in HTML.
    Since Jaguar and Panther Mail do not support composing or forwarding HTML, you can't embed images or photos in the message body anyway.
    RTF with Tiger Mail is really HTML and although Tiger Mail does not include an HTML composer/editor, you can copy/paste HTML format from a web page and forward HTML received.
    Images/photos and single page PDF attachments are revealed as inline or viewed in place within the body of the message by default which cannot be turned off. This applies to received and sent messages which is not the same as being embedded. Embedded requires HTML and an embedded attachment is not a true attachment. All Mail.app versions render HTML received but you cannot attach a photo or image as embedded with Jaguar or Panther Mail so it doesn't matter if you use RTF or Plain Text in regards to photo/image or single page PDF attachments which appear as inline or viewed in place within the body of the message by default regardless.
    When you use Plain Text for message composition, the receiving mail client renders the text in whatever font the reader chooses.
    IMO, everyone should use Plain Text for message composition. Messages would be boring to some but the majority if not all problems experienced with email would be eliminated if HTML was banned from message composition.

  • Sending Email using both HTML and plain text

    I could use some advise on how to start researching email for
    both HTML and plain text messages.
    I have a script called class.phpMail.php, but the code is
    alittle advanced for me. Basically I can't get
    it to work on my server and I don't know where to begin the
    learning process here.
    I talked to my provider, "HOST" company goDaddy.com and I was
    told that to connect so that I could send email I would need this
    line of code. They didn't say it should by in my php.ini file but
    that was where I found it.
    SMTP = relay-hosting.secureserver.net
    This is the smtp address that my provider uses to make the
    connection with my mail client.
    I was told that with this line of code I would not need a
    password or username
    I did some further reseach and I found an article that stated
    that my original error:
    Warning: fsockopen() expects parameter 2 to be long, string
    given in ...../php/class.smtp.php on line 105
    was being caused by this code because the $port value needed
    to be between 1 - 65365:
    $this->smtp_conn = fsockopen($host, # the host of the server
    $port, # the port to use ----- "this is line 105"
    $errno, # error number if any
    $errstr, # error message if any
    $tval); # give up after ? secs
    In particular the $port value was coming in corrupted and
    that I needed to cast it.
    I did as they suggested and made it an (int) as they
    suggested.
    $this->smtp_conn = fsockopen($host, # the host of the server
    (int)$port, # the port to use
    $errno, # error number if any
    $errstr, # error message if any
    $tval); # give up after ? secs
    It resolved part of the error message however, the other half
    of the error message is shown below:
    Message could not be sent.
    Mailer Error: Language string failed to load: connect_host
    What exactly is the connect_host they refer to in this
    message?
    Would it be the string in my php.ini file refering to the
    SMTP = relay-hosting.secureserver.net
    I have allot of what I think are disconnected questions as I
    really have just begun to work
    with the mail() function. If anyone has the time to educate
    this newbie into the wonderful
    world of email() I would appreciate it.
    Thank You
    Kevin Raleigh

    Sorry to dig up an old post, but we've spent the last few days trying to work out why an email campaign being sent from BC is going into the Junk folder of recipients that use MS Exchange. We've fixed quite a lot of issues, including the fact that Legacy Templates have random JS injected just before they get sent, so we had to switch to the new template system. We've narrowed the issue down to one of three things:
    1. A missing alt tag on the tracking image that BC drops into the email (pretty unlikely)
    2. The BC Europe IP (54.240.14.45) is blacklisted here: UCEPROTECTL2 (possible, but if you actually look it's not the IP itself, but another IP on the same network, so unlikely)
    3. The fact that the HTML email has no text component.
    I agree, BC is late on this but I think that it needs to be added, even if most users have HTML-ready email clients, spam checkers do seem to prefer multi-MIME emails.
    This is backed up by the following SpamAssassin rule, which we are currently unable to resolve:
    -1.105
    MIME_HTML_ONLY
    Message only has text/html MIME parts
    You should also include a text version of your message (text/plain)
    So in my opinion, BC do still need to add this as a feature, otherwise the system is not viable for our customers and we'll have to look elsewhere.

  • I am creating a form on LiveCycle Designer and I am trying to create a form that has a e-mail submit button.  When the butten is utilized it attaches the form to the e-mail in an plain text .xml format rather than the pdf format.  Is there a quick fix?

    I am creating a form on LiveCycle Designer and I am trying to create a form that has a e-mail submit button.  When the button is utilized it attaches the form to the e-mail in an plain text .xml format rather than the pdf format.  Is there a quick fix?

    Hi,
    You have the choice between xml or pdf, in later versions of designer you can choose with a dropdown on the email button Object palette, the "Submit As";
    In earlier version you had to edit the XML Source and change the format from xml to pdf (or vice-versa);
    Regards
    Bruce

Maybe you are looking for