Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-11-2013, 01:58 AM   PM User | #1
Eddie_E
New Coder

 
Join Date: May 2008
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Eddie_E is an unknown quantity at this point
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) .
"\n" 
"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() );

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

Eddie
Eddie_E is offline   Reply With Quote
Old 02-11-2013, 02:08 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
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.
mlseim is offline   Reply With Quote
Old 02-11-2013, 11:42 PM   PM User | #3
Eddie_E
New Coder

 
Join Date: May 2008
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Eddie_E is an unknown quantity at this point
Cool easy, thx... sorted :-)
Eddie_E is offline   Reply With Quote
Old 02-12-2013, 01:23 AM   PM User | #4
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,447
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
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.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:27 PM.


Advertisement
Log in to turn off these ads.