Date: Tue, 14 Apr 2009 16:33:33 -0600 From: Ray <ray@stilltech.net> To: freebsd-questions@freebsd.org Subject: Fwd: Re: [PHP] putting variables in a variable Message-ID: <200904141633.33517.ray@stilltech.net>
next in thread | raw e-mail | index | archive | help
Sorry, I replied to OP, not list Ray ---------- Forwarded Message ---------- Subject: Re: [PHP] putting variables in a variable Date: Tuesday 14 April 2009 From: Ray <ray@stilltech.net> To: "Hulf" <ross@blue-fly.co.uk> On Monday 28 March 2011 05:06:14 Hulf wrote: > Hi, > > I am making and HTML email. I have 3 images to put in. Currently I have > > $body .=" > <table> > <tr> > <td><img src=\"image1.jpg\"></td> > </tr> > > <tr> > <td></td> > </tr> > </table> > "; > > > ideally I would like to have > > $myimage1 = "image1.jpg"; > $myimage2 = "image2.jpg"; > $myimage3 = "image3.jpg"; > > > and put them into the HTML body variable. I have tried escaping them in > every way i can think of, dots and slashes and the rest. Any ideas? > > > Ross Hi Ross, The example you are showing will only put the image name into the email. The email client will then look on the receivers machine for the image. There are two ways to do what you are trying to do. One is to send just a link to the images. For example: use $myimage1= "www.example.com/images/image1.jpg" this of course assumes that you have the images hosted somewhere that the mail client can find them. The other option involves including the images as attachments. The easiest way imo to do this is with the PHP Mime Mail class. http://www.phpguru.org/static/htmlMimeMail5.html PHP 4 version is also available if that's what you need. Ray -------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904141633.33517.ray>