Jump to content

[SOLVED] Image to attachment


Guest

Recommended Posts

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
Share on other sites

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
Share on other sites

lol, I'm willing to look into it. Educates you, as well as me  :D

 

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
Share on other sites

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
Share on other sites

It worked perfectly!!! ;D

 

	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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.