Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2008
    Thanked 0 Times in 0 Posts

    Adding an image on my copy email

    Hi, I have a form which allows the user to tick a checkbox and have a copy sent back to them. This all functions well but I would like to add my logo to this response. I have tried adding the img to the message but this just displays the URL not the image, how do I edit this?

    PHP Code:
    $messageproper ="\n\n" .
    "Name: " .
    ucwords($_POST['name']) .
    "\n" .
    "Email: " .
    ucwords($email) .
    "Type: " .
    ucwords($_POST['type']) .
    "\n" .
    "Comments: " .
    $_POST['message'] .
    "\n\n\n\n\n\n\n" .
    '<img src="http://www.begraphics.com/images/signature.jpg">' 
    "\n\n" ;

    $messageproper trim(stripslashes($messageproper));

    mail($mailto$subject$messageproper"From: \"$vname\" <".$_POST['email'].">\nReply-To: \"".ucwords($_POST['name'])."\" <".$_POST['email'].">\nX-Mailer: PHP/" phpversion() );

    $selfcopy == "yes" )
    mail($email$subject$messageproper"From: \"$vnamereply\" <".$_POST['email'].">\nReply-To: \"".ucwords($_POST['name'])."\" <".$_POST['email'].">" ); 
    Many thanks


  2. #2
    Master Coder
    Join Date
    Jun 2003
    Cottage Grove, Minnesota
    Thanked 1,129 Times in 1,120 Posts
    You need to send an HTML email (not plain text).
    Find examples using Google: http://www.google.com/search?q=php+h...il&btnG=Search

    You have the right idea though about the image being a remote link. Even with HTML emails, images are referenced from remote sites. If someone doesn't allow HTML emails, or have some sort of "safe mode", they will just get a box with an -X- where the images should be.

  3. #3
    New Coder
    Join Date
    May 2008
    Thanked 0 Times in 0 Posts
    Cool easy, thx... sorted :-)

  4. #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 818 Times in 807 Posts
    Quote Originally Posted by mlseim View Post
    You have the right idea though about the image being a remote link.
    Not if you want everyone to see them they are not. Linked images are blocked by email programs because they allow the sender to log when people open the email and so if a spam email is accidentally opened not blocking them would tell the spammer that it is worth sending thousands more spam emails to that address.

    For images to display without asking the recipient to allow remote access first you need to embed the image into the email itself. You do this by setting up an HTML email with a multipart/related part that contains the base64 encoded copy of the image itself that is then referenced from the img tag in the other section of the email.

    For a small image such as a logo you are far better to embed the image in the email rather than link it as it will not make the email all that bigger and will display for everyone instead of just the small percentage you manage to convince to turn off that security feature for your email.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts