Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6125593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:15:57+00:00 2026-05-23T16:15:57+00:00

For starters, I am using the following: php 5.3 PHPmailer – to send stmp

  • 0

For starters, I am using the following:

  • php 5.3
  • PHPmailer – to send stmp email with google apps
  • GD to create the iamge

  • I am able to take a previously existing file, add text to that file and output to a browser.

  • I am able to send email with an existing embedded image using simple functions within phpmailer
  • I am NOT able to dynamically modify the first file, have it saved in memory, then embed THAT image in my email.

When creating my image, I am using a very basic sample script:

EDIT

I modified my code to the following: seems to run faster as well as easier to read. An actual file is created however whereas I would prefer a temporary file I could destroy after or simply use binary data. Is there a binary output function similar to imagegif()?

$photo = imagecreatefromgif('sample.gif');
imagealphablending($photo, true);
$fontsize = 20;
$font = '../times.ttf';
$fontcolor = imagecolorallocate($photo, 0, 0, 0);
$angle = 0;
$x = 100;
$y = 100;
$text = 'THIS IS A BLOB OF TEXT YO!';
imagettftext($photo, $fontsize, $angle, $x, $y, $fontcolor, $font, $text);
imagegif($photo, 'test.gif');

unfortunately, this wants to output my file to the browser, then proceed with the remainder of the script and send the email (without embedded image).

I know I am probably missing something simple but has anybody run into this issue before?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:15:58+00:00Added an answer on May 23, 2026 at 4:15 pm

    Firstly you need to a) save the image to temporary file using second argument of imagegif function; b) use PHP output buffering to capture the result sent to output and clean it from the response (see http://php.net/ob).

    Afterwards you need to know how to embed the image as attachment to the email letter or copy it as real file with http address available and point the <img href=""/> to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following this tutorial to create custom Wordpress options the function within theme/functions/admin-menu.php which
I want to create my very first web app using HTML, MySQL, PHP and
Hello I want to create a dll with some functions. For starters I'm trying
all; I'd like to be able to create a new document in Dreamweaver that
I have the following php code: $seasons = array(Autumn, Winter, Spring, Summer); Now I
I'm a starter at using pthreads with C in Linux. I need to create
I'm running the following code on Ubuntu 10.10, using OpenJDK 1.6.0_18: package mypkg; public
I would like to start using the WCF Rest Starter Kit's HttpClient to build
I've written some code using the REST starter kit and it works fine on
I created a site using wordpress. I installed the 'starkers' theme and modified it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.