FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » CLP - ON TOPIC! - Need PHP form email help, Please!
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: CLP - ON TOPIC! - Need PHP form email help, Please! [message #173137 is a reply to message #173134] Wed, 23 March 2011 19:18 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
Tim Streater wrote:
> In article <230320111257235633%batwzrd(at)hotmail(dot)com>,
> Tim <batwzrd(at)hotmail(dot)com> wrote:
>
>> In article <imbdle$g3p$1(at)news(dot)eternal-september(dot)org>, Jerry Stuckle
>> <jstucklex(at)attglobal(dot)net> wrote:
>
>>> No, you're not, and creating an html email with embedded images is
>> not > easy - but it is NOT a PHP question.
>>>> First of all you need to figure out how to create the email in the
>> first > place. Then you can worry about the PHP code needed to create
>> it.
>>>> Get a working page in your favorite email program first and see
>> what the > source looks like. That will help you.
>>>> Right now you're trying to create something with no idea what
>> you're > creating. You can keep using trial and error methods and
>> maybe get > there. Or you can do as I first suggested and find out
>> how to create > the email you want first, ignoring any language
>> considerations.
>>
>> I looked at an email with images both attached and embedded: the same
>> images in both.
>
> Yes, and you'll have to learn how an e-mail is structured. Try looking
> at these RFCs:
>
> RFC 5322 (Internet Message Format), and RFCs 2045, 2046, 2047, 2048,
> 2049, (MIME), and 2183. You'll need to find which bits you need for your
> particular situation.
>
>> The line that placed the image inline looks like this:
>>
>> <IMG=20
>> id=3DMA2.1289279864 border=3D0=20
>> =
>> src=3D"cid:4EDBE5C8B2CC44F8ADDD6F853B321989@desktop619"=20
>> width=3D480 height=3D604=20
>> =
>> DATASIZE=3D"144908">
>
> Yes, that's encoded using quoted-printable (e.g., =20 is a space).
>
>> Where "cid:4EDBE5C8B2CC44F8ADDD6F853B321989@desktop619" is the Content
>> ID. Obviously this is something that is compiled by the email program
>> when the email is sent. Since HTML can not create itself, I need some
>> code to do it.
>>
>> I have created the email, as I said, and it works perfectly other than
>> this image issue. The source for the emails from this form look like
>> this:
>>
>> --FTG_BOUNDRY
>> Content-Type: text/html; charset="UTF-8"
>> Content-Transfer-Encoding: base64
>>
>> PGh0bWw+CjxoZWFkPgo8dGl0bGU+PC90aXRsZT4KPC9oZWFkPgo8Ym9keT4KPHRhYmxlIHdp
>> ZHRo
>> PSI4MDAiIGJvcmRlcj0iMCIgY2VsbHNwYWNpbmc9IjIiIGNlbGxwYWRkaW5nPSIxMCI+PHRy
>> Pgo8
>
> [snip]
>
> This is an email "part", encoded in base-64. Why is it thus encoded -
> who is doing that?
>
His email client. I recommended he should disassemble it and reverse
engineer it, because that is what I did.

Look the code I posted should work or at least work near enough to
puzzle the thing out. I only went as far as getting something that works
for me BUT the basic message format for embedded images is this:

Create OR they can reference inline embedded stuff: there is a special
format for that. src="cid:...."


Then you have to set up the mail headers to reflect the fact this is
multipart mime encoded HTML and that certain bits will be base 64 encoded,.

Then you have to create the message with separators, parts and where
appropriate base 64 encoding.

And, as I discovered,. all mail clients are not equal, and PHP frigs
with line endings. I had to rework my code to first of all work on Mac
mail, then Outlook, and finally going PHP4 to 5 broke it..all to do with
line endings.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ip address of client
Next Topic: Islandnet.com dropping support for PHP4
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 00:12:49 GMT 2024

Total time taken to generate the page: 0.03967 seconds