1
So, I have a script that generates a boleto in image format (using imagegif()).
I wonder if there is a way to send this attached boleto (use phpmailer) without having to save the image to disk. Reason? Avoid staying using disk.
I mean, is there any magic for me to do that?
The problem of this is that it needs to generate the file. I don’t know if it is so important not to generate the file but it is a requirement that it put.
– Maniero
@bigown This will not generate any file.
imagegif()
will print the image in the output buffer and theob_get_clean()
will pick up directly from there. Nothing goes to the file system.– André Ribeiro
imagecreatefromstring() can also be used..
– Daniel Omine
So he accepts one stream any instead of a file? Did not know this.
– Maniero
@bigown That’s right.
– André Ribeiro
For now it worked. I’ll see if my manager accepts this way.
– Raul3k
@daniel-Omine if you pass the second argument in imagegif it creates a file. In the case of imagecreatefromstring I could use the
$mail->addStringAttachment(imagecreatefromstring($img));
? OBS: this way was not, only with the @bigown– Raul3k
Good guys, thank you. That’s right!
– Raul3k
see the documentation to see the appropriate use for your Brow case.
– Daniel Omine