Please help: Mail-Transfer encoding problem

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Please help: Mail-Transfer encoding problem

    Hi People !

    I have an Urgent Problem and greatly appreciate your help:

    My script sends multipart emails using the MAIL_MIME package from
    pear.php.net Works great so far but.....

    ....Sometimes (depending on the mail server that handles the mailing)
    all quotation marks in an HTML body of a multipart message become
    escaped.

    Example:

    <form name="form1"> becomes <form name=\"form1\">

    That of course cripples all HTML formatted emails. Strange enough:
    On some servers the problem does not appear when the transfer-encoding
    is "base64" instead of "quoted-printable". On others it does not
    matter. I can't see any consistency and don't know how to solve the
    problem.

    Any ideas?

    ...ah...and does anybody know another mail packages similar to
    MAIL_MIME in order to implement multipart email functionality in a php
    script?

    Thanks a ton all.
    Jerry Guest

  2. Similar Questions and Discussions

    1. how to disable "Transfer-Encoding: chunked"
      Hello, ColdFusion 6/7 (on Linux/Apache 1.3/2) automatically adds the header "Transfer-Encoding: chunked" to all responses. I would like to turn...
    2. Encoding Problem
      Im pulling an attribute from an XML doc, which is a regexp. The regexp is then used on CFHTTP.filecontent, in order to parse out specfic links from...
    3. Mail:Sender - HTML Mail with alternatives problem
      I'm trying to generate an HTML mail with text alternatives using the mail:sender module. As everybody can see below the message was created and...
    4. [PHP-DEV] Feature Request - encoding/decoding mail and nntp attachements
      Exo ludo wrote: PHP already has base64 en/decoding. See the manual under base64_encode. I haven't seen any native yEnc extensions, though. ...
    5. [PHP-DEV] Feature Request - encoding/decoding mail and nntp attachements
      Hi, Im lookin for encoding/decoding base64 (and Yenc) attachements in my mail and NNTP programs. After having tested several PHP classes (ex:...
  3. #2

    Default Re: Please help: Mail-Transfer encoding problem

    Jerry wrote:
    > My script sends multipart emails using the MAIL_MIME package from
    > pear.php.net Works great so far but.....
    >
    > ...Sometimes (depending on the mail server that handles the mailing)
    > all quotation marks in an HTML body of a multipart message become
    > escaped.
    >
    > Example:
    >
    > <form name="form1"> becomes <form name=\"form1\">
    >
    [url]http://www.php.net/stripslashes[/url]


    JW



    Janwillem Borleffs Guest

  4. #3

    Default Re: Please help: Mail-Transfer encoding problem

    Hi Thank you.... but ...

    The point is that all quotation marks are handed over to the mail
    handler without the slashes. The slashes seem to be added somehow
    during the mail process. The reason for me to think that is the fact
    that the emails are OK when sent from one server but are crippled when
    being sent from another one.

    I installed my mail script on two different websites (servers) and
    found that the results were different as emails sent from the first
    work well and the those from the second do not.

    Any ideas on why that could be?

    Jerry

    On Fri, 10 Sep 2004 13:36:38 +0200, "Janwillem Borleffs"
    <jw@jwscripts.com> wrote:
    >Jerry wrote:
    >> My script sends multipart emails using the MAIL_MIME package from
    >> pear.php.net Works great so far but.....
    >>
    >> ...Sometimes (depending on the mail server that handles the mailing)
    >> all quotation marks in an HTML body of a multipart message become
    >> escaped.
    >>
    >> Example:
    >>
    >> <form name="form1"> becomes <form name=\"form1\">
    >>
    >
    >[url]http://www.php.net/stripslashes[/url]
    >
    >
    >JW
    >
    >
    Jerry Guest

  5. #4

    Default Re: Please help: Mail-Transfer encoding problem

    Jerry wrote:
    > Any ideas on why that could be?
    >
    With the magic_quotes_gpc directive enabled, all Get/Post/Cookie data gets
    escaped.

    My guess is that somewhere down the line, the email body is submitted.


    JW



    Janwillem Borleffs Guest

  6. #5

    Default Re: Please help: Mail-Transfer encoding problem

    Hello,

    On 09/10/2004 08:29 AM, Jerry wrote:
    > Hi People !
    >
    > I have an Urgent Problem and greatly appreciate your help:
    >
    > My script sends multipart emails using the MAIL_MIME package from
    > pear.php.net Works great so far but.....
    >
    > ...Sometimes (depending on the mail server that handles the mailing)
    > all quotation marks in an HTML body of a multipart message become
    > escaped.
    >
    > Example:
    >
    > <form name="form1"> becomes <form name=\"form1\">
    > That of course cripples all HTML formatted emails. Strange enough:
    > On some servers the problem does not appear when the transfer-encoding
    > is "base64" instead of "quoted-printable". On others it does not
    > matter. I can't see any consistency and don't know how to solve the
    > problem.
    >
    > Any ideas?
    It seems that you have magic quotes option enabled. Just disable it. If
    that does not do it, it is probably a bug in the class you are using.

    I do not advise using base64 encoding for HTML messages as it would be
    immediately dropped by many spam filters.

    > ..ah...and does anybody know another mail packages similar to
    > MAIL_MIME in order to implement multipart email functionality in a php
    > script?
    You may want to try this other package as it works perfectly for me:

    [url]http://www.phpclasses.org/mimemessage[/url]


    --

    Regards,
    Manuel Lemos

    PHP Classes - Free ready to use OOP components written in PHP
    [url]http://www.phpclasses.org/[/url]

    PHP Reviews - Reviews of PHP books and other products
    [url]http://www.phpclasses.org/reviews/[/url]

    Metastorage - Data object relational mapping layer generator
    [url]http://www.meta-language.net/metastorage.html[/url]
    Manuel Lemos Guest

  7. #6

    Default Re: Please help: Mail-Transfer encoding problem

    Dear Manuel,

    Thanks so much for your invaluable info. I greatly appreciate your
    excellent package and help. Thank you

    Greetings!

    On Fri, 10 Sep 2004 15:13:39 -0300, Manuel Lemos <mlemos@acm.org>
    wrote:
    >Hello,
    >
    >On 09/10/2004 08:29 AM, Jerry wrote:
    >> Hi People !
    >>
    >> I have an Urgent Problem and greatly appreciate your help:
    >>
    >> My script sends multipart emails using the MAIL_MIME package from
    >> pear.php.net Works great so far but.....
    >>
    >> ...Sometimes (depending on the mail server that handles the mailing)
    >> all quotation marks in an HTML body of a multipart message become
    >> escaped.
    >>
    >> Example:
    >>
    >> <form name="form1"> becomes <form name=\"form1\">
    >
    >> That of course cripples all HTML formatted emails. Strange enough:
    >> On some servers the problem does not appear when the transfer-encoding
    >> is "base64" instead of "quoted-printable". On others it does not
    >> matter. I can't see any consistency and don't know how to solve the
    >> problem.
    >>
    >> Any ideas?
    >
    >It seems that you have magic quotes option enabled. Just disable it. If
    >that does not do it, it is probably a bug in the class you are using.
    >
    >I do not advise using base64 encoding for HTML messages as it would be
    >immediately dropped by many spam filters.
    >
    >
    >> ..ah...and does anybody know another mail packages similar to
    >> MAIL_MIME in order to implement multipart email functionality in a php
    >> script?
    >
    >You may want to try this other package as it works perfectly for me:
    >
    >[url]http://www.phpclasses.org/mimemessage[/url]
    Jerry Guest

  8. #7

    Default Re: Please help: Mail-Transfer encoding problem

    Dear Manuel:

    Your mime-mail package works great but I have a small problem and hope
    you can help me out on this:

    When I send via SMTP I get the following error and don't know what it
    actually means:

    "Error: reached the end of data while reading from the SMTP server
    conection"

    Can you help?
    Thank you so much.
    Greetings

    On Fri, 10 Sep 2004 15:13:39 -0300, Manuel Lemos <mlemos@acm.org>
    wrote:
    >Hello,
    >
    >On 09/10/2004 08:29 AM, Jerry wrote:
    >> Hi People !
    >>
    >> I have an Urgent Problem and greatly appreciate your help:
    >>
    >> My script sends multipart emails using the MAIL_MIME package from
    >> pear.php.net Works great so far but.....
    >>
    >> ...Sometimes (depending on the mail server that handles the mailing)
    >> all quotation marks in an HTML body of a multipart message become
    >> escaped.
    >>
    >> Example:
    >>
    >> <form name="form1"> becomes <form name=\"form1\">
    >
    >> That of course cripples all HTML formatted emails. Strange enough:
    >> On some servers the problem does not appear when the transfer-encoding
    >> is "base64" instead of "quoted-printable". On others it does not
    >> matter. I can't see any consistency and don't know how to solve the
    >> problem.
    >>
    >> Any ideas?
    >
    >It seems that you have magic quotes option enabled. Just disable it. If
    >that does not do it, it is probably a bug in the class you are using.
    >
    >I do not advise using base64 encoding for HTML messages as it would be
    >immediately dropped by many spam filters.
    >
    >
    >> ..ah...and does anybody know another mail packages similar to
    >> MAIL_MIME in order to implement multipart email functionality in a php
    >> script?
    >
    >You may want to try this other package as it works perfectly for me:
    >
    >[url]http://www.phpclasses.org/mimemessage[/url]
    Jerry Guest

  9. #8

    Default Re: Please help: Mail-Transfer encoding problem

    >Your mime-mail package works great but I have a small problem and hope
    >you can help me out on this:
    >
    >When I send via SMTP I get the following error and don't know what it
    >actually means:
    >
    >"Error: reached the end of data while reading from the SMTP server
    >conection"
    When you send a piece of mail on a SMTP connection, you are supposed
    to send:

    DATA\r\n
    text of the mail, including headers\r\n
    ..\r\n

    If you hit EOF without sending a period alone on a line, chances are
    you either forgot to send the period, or the text of the mail
    didn't end with the end of a line.

    Gordon L. Burditt
    Gordon Burditt Guest

  10. #9

    Default Re: Please help: Mail-Transfer encoding problem

    Hello,

    On 09/12/2004 08:06 AM, Jerry wrote:
    > Dear Manuel:
    >
    > Your mime-mail package works great but I have a small problem and hope
    > you can help me out on this:
    >
    > When I send via SMTP I get the following error and don't know what it
    > actually means:
    >
    > "Error: reached the end of data while reading from the SMTP server
    > conection"
    >
    > Can you help?

    This means that there was a timeout or the server disconnected while the
    class was expecting some response from the server.

    I don't know if you really need to use SMTP, but if you do, just enable
    smtp_debug variable to see the SMTP dialog with the server. The reason
    of this problem should be explained looking at that dialog.

    --

    Regards,
    Manuel Lemos

    PHP Classes - Free ready to use OOP components written in PHP
    [url]http://www.phpclasses.org/[/url]

    PHP Reviews - Reviews of PHP books and other products
    [url]http://www.phpclasses.org/reviews/[/url]

    Metastorage - Data object relational mapping layer generator
    [url]http://www.meta-language.net/metastorage.html[/url]
    Manuel Lemos Guest

  11. #10

    Default Re: Please help: Mail-Transfer encoding problem

    Dear Manuel,

    Thank you for a great package and your commitment. I have been testing
    it today and ran into a problem which I am not sure if it is a bug in
    your coding or if it is just me being sufficiently ignorant to see
    what I am doing wrong. It would be wonderful if you could just take a
    quick look and see yourself whether or not your class works correctly.

    The situation:

    I am sending different multipart messages via SMTP to a group of
    colleages. While running the send script individually (one by one)
    everything works fine. In order to make the mailing a bit more
    convenient I placed the send-routine in a loop and let it run. The
    loop executes exactly the same routine with only the "to_address"
    changing.
    The strange thing now is that it fails to login into the SMTP server
    every second loop. So, the messages are being sent successfully to
    recipient 1,3,5,7,.... However, recipient 2,4,6,8,... would not
    receive anything. So I ran the script in debug mode and it revealed
    that in every second loop the send-routine was failing to login.

    I have copied the protocol and marked the relevant lines.
    Please see: [url]http://209.197.87.129/smtp/mlemos.htm[/url]

    Manuel, I very much appreciate your dedication and help and I really
    hope to not steal too much of your time. However, I thought you might
    be interested in this experience for that it could possibly be a bug
    in your package (... well, if it is a bug at all. I beg your pardon
    for my ignorance).
    Do you have an idea of what the problem could be?

    Many Greetings
    Jerry Wilkins


    On Sun, 12 Sep 2004 14:24:47 -0300, Manuel Lemos <mlemos@acm.org>
    wrote:
    >Hello,
    >
    >On 09/12/2004 08:06 AM, Jerry wrote:
    >
    > > Dear Manuel:
    > >
    > > Your mime-mail package works great but I have a small problem and hope
    > > you can help me out on this:
    > >
    > > When I send via SMTP I get the following error and don't know what it
    > > actually means:
    > >
    > > "Error: reached the end of data while reading from the SMTP server
    > > conection"
    > >
    > > Can you help?
    >
    >
    >This means that there was a timeout or the server disconnected while the
    >class was expecting some response from the server.
    >
    >I don't know if you really need to use SMTP, but if you do, just enable
    >smtp_debug variable to see the SMTP dialog with the server. The reason
    >of this problem should be explained looking at that dialog.
    Jerry Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139