Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > PHP: Attach and embed GD generated image

PHP: Attach and embed GD generated image
Thread Tools
Junior Member
Join Date: Aug 2002
Status: Offline
Reply With Quote
Dec 9, 2003, 05:22 PM
 
Is there a way to attach an image generated by GD without first outputting the image to file?

Also, how does one link to the attached file from within the email body (HTML email)?

This has been racking my brain for weeks.

Aj
Austin Jackson
EducatorsHandbook.com - because great decisions are based on great data.
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Dec 10, 2003, 03:51 PM
 
To get the data for the image just use fopen/fgets on a URL to request the image from a separate script (so you would have two scripts, and actually call one from the other as if it was a browser). You can find some quick documentation on the PHP site:

http://www.php.net/mailing-lists.php

I haven't created HTML email, so don't know the linking process, but the data is undoubtedly just part of the MIME/Mulitipart stream... You might want to make sure you get the encoding right... Hope that sends you in the right direction.
     
Junior Member
Join Date: Aug 2002
Status: Offline
Reply With Quote
Dec 10, 2003, 03:57 PM
 
Originally posted by larkost:
To get the data for the image just use fopen/fgets on a URL to request the image from a separate script (so you would have two scripts, and actually call one from the other as if it was a browser). You can find some quick documentation on the PHP site:

http://www.php.net/mailing-lists.php

I haven't created HTML email, so don't know the linking process, but the data is undoubtedly just part of the MIME/Mulitipart stream... You might want to make sure you get the encoding right... Hope that sends you in the right direction.
OK, thanks, this is actually extremely helpful. I am doing that now when I display the image in a browser, I just did not know if the fopen or fgets on the URL would read the code from the php itself or the imaged generated by the function called within it. Thanks a bunch, I will post back if/when I get it working!

Aj
Austin Jackson
EducatorsHandbook.com - because great decisions are based on great data.
     
Junior Member
Join Date: Aug 2002
Status: Offline
Reply With Quote
Dec 10, 2003, 11:00 PM
 
Problem solved!!! You need to use the output control functions to get it done, but it works splendidly!

Thank you for the assistance!
(Last edited by austinjackson; Dec 11, 2003 at 03:08 AM. )
Austin Jackson
EducatorsHandbook.com - because great decisions are based on great data.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:32 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2