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 <[email protected]>' . "\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> Link to comment https://forums.phpfreaks.com/topic/12677-help-with/ 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] ? Link to comment https://forums.phpfreaks.com/topic/12677-help-with/#findComment-48632 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. Link to comment https://forums.phpfreaks.com/topic/12677-help-with/#findComment-48684 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 <[email protected]>' . "\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.. Link to comment https://forums.phpfreaks.com/topic/12677-help-with/#findComment-48686 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.