kd5h Posted June 22, 2006 Share Posted June 22, 2006 Can someone tell me why this <img src will not work.The email appears go but it doesn't really. If I change the <img src tag ( delete it )the email goes. I'm at a loss !!! <?php$subject = 'Post Card from Cruz N';$name = $_POST["name"];$email = $_POST["email"];$picture = $_POST["picture"];$headers = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/html; charset=iso-8859-1' . "\n";$headers .= 'From: user <user@website.com>' . "\n";$message = '<html><head><title>Picture</title></head>';$message .= '<body><p>Here is the picture</p>';$message .= '<img src="'; $message .= $picture;$message .= '" alt="picture">';$message .= '</body></html>';;// Mail it$ok = mail("$name <$email>", $subject, $message, $headers);if ( $ok ) echo "OK";?><html><head><title>Message Send</title></head><body><h3>Your message has been sent</h3>Message sent to <?php echo ( $name ); ?> <br>at Email address <?php echo ( $email ); ?> <br>Picture <?php echo ( $picture ); ?> <br><br><img src = <?php echo ( $picture ); ?> ><br><br></body></html> Quote Link to comment Share on other sites More sharing options...
AndyB Posted June 22, 2006 Share Posted June 22, 2006 There's an orphan ; after the message string concatenation ends. Remove it.For an image to display in an email you need the full domain path included. Is $picture something like [a href=\"http://www.mysite.com/happyface.jpg\" target=\"_blank\"]http://www.mysite.com/happyface.jpg[/a] ? Quote Link to comment Share on other sites More sharing options...
kd5h Posted June 23, 2006 Author Share Posted June 23, 2006 [!--quoteo(post=387007:date=Jun 22 2006, 05:35 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 22 2006, 05:35 PM) [snapback]387007[/snapback][/div][div class=\'quotemain\'][!--quotec--]There's an orphan ; after the message string concatenation ends. Remove it.For an image to display in an email you need the full domain path included. Is $picture something like [a href=\"http://www.mysite.com/happyface.jpg\" target=\"_blank\"]http://www.mysite.com/happyface.jpg[/a] ?[/quote]Yes, $picture is the full domain path.I have tried every combonation to get to work.Funny think is, if I place $message at the end of the HMTL it will display the message just like I want it on the webpage.go figure. Quote Link to comment Share on other sites More sharing options...
kd5h Posted June 23, 2006 Author Share Posted June 23, 2006 $headers = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/html; charset=iso-8859-1' . "\n";$headers .= 'From: CruzN <cruzn@virtualhale.com>' . "\n";$message = '<html><head><title>PostCard from Cruz N</title></head>';$message .= '<body><p>Here is a postcard from Cruz N</p>';[b]$message .= '<img src = "http://www.virtualhale.com/arky.jpg" alt = "picture">'; [/b]$message .= '</body></html>';If I comment this line out the message goes. I don't understand what keeps it from going with this tag.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.