Guest Posted June 30, 2008 Share Posted June 30, 2008 I have a gif image created on the fly that I want to send as an attachment is there a way that I can do that without storing a temporary file? Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/ Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 I believe so. have a go at it yourself first and post what you got so far. Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-577946 Share on other sites More sharing options...
Guest Posted June 30, 2008 Share Posted June 30, 2008 I can do it with the temp file but cannot figure out a way without. Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-577948 Share on other sites More sharing options...
Guest Posted June 30, 2008 Share Posted June 30, 2008 I was looking more into imagejpeg to see if I could store the jpeg into a variable but all it returns is a bool or I could store it in a file. bool imagejpeg ( resource $image [, string $filename [, int $quality ]] ) so that is completely useless im running out of ideas does anyone know a way without a temp file? Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-577960 Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 I'm working on it... Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-577972 Share on other sites More sharing options...
Guest Posted June 30, 2008 Share Posted June 30, 2008 Oh thank you dont go out of your way though I just wondered if someone knew it off there head/ Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-577975 Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 lol, I'm willing to look into it. Educates you, as well as me I want to make sure I understand what your after. You're sending a e-mail through PHP and want to attach a GIF image you have on your webhost? or the image is dynamically made with PHP ? Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-577977 Share on other sites More sharing options...
Guest Posted June 30, 2008 Share Posted June 30, 2008 I think im on to somthing I have found this. ob_start(); echo "here is a string"; $string=ob_get_contents(); ob_end_clean(); I am going to try it out then ill let you know what happens. Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-577984 Share on other sites More sharing options...
Guest Posted June 30, 2008 Share Posted June 30, 2008 As for your question its a dynamically made gif that im tring to attach. Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-577985 Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 ok, I don't know if that can be used for this circumstance, but I do use it however with headers. As for your question its a dynamically made gif that im tring to attach. ok. That does make it slightly more tricky. Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-577986 Share on other sites More sharing options...
Guest Posted June 30, 2008 Share Posted June 30, 2008 It worked perfectly!!! ob_start(); imagejpeg($dst_img); $string=ob_get_contents(); ob_end_clean(); $mail->AddStringAttachment($string, "YourPhoto.jpeg"); $mail->Send(); I am using php mailer to send it out. I am working on putting it up on http://www.usualbeings.com/wallpapers if you want to check on my progress. Its how im sending it to phones. Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-578001 Share on other sites More sharing options...
Guest Posted June 30, 2008 Share Posted June 30, 2008 Thank you for your help Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-578002 Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 no problem, you did all the work Link to comment https://forums.phpfreaks.com/topic/112544-solved-image-to-attachment/#findComment-578006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.