contra10 Posted March 8, 2009 Share Posted March 8, 2009 im testing out my email but i can't view the image in the email, everything else shows <?php $to = ($email); $subject = "Event Updates In Your city"; //create a boundary string. It must be unique //so we use the MD5 algorithm to generate a random hash $random_hash = md5(date('r', time())); $from = "admin@worldnwired.com"; $headers = "From: $from"; //add boundary string and mime type specification $headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; //define the body of the message. ob_start(); //Turn on output buffering ?> --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <table bgcolor="#3366FF"> <tr><td> [b]<img src="eventimg.png">[/b] <h2>The Latest for <?php echo "$city"; ?></h2><br> ... the image is in the folder and the file path is correct Quote Link to comment https://forums.phpfreaks.com/topic/148429-solved-cant-view-image-in-email/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 8, 2009 Share Posted March 8, 2009 All links and URL's in an email must be fully qualified absolute URL's because at the time they are rendered in the email client there is no domain information present - http://your_domain.com/your_path/your_file.ext Quote Link to comment https://forums.phpfreaks.com/topic/148429-solved-cant-view-image-in-email/#findComment-779263 Share on other sites More sharing options...
contra10 Posted March 8, 2009 Author Share Posted March 8, 2009 im trying this but still image wont show <table bgcolor="#3366FF"> <tr><td> <img src="http://localhost/image.html"> image does not show in that link tho Quote Link to comment https://forums.phpfreaks.com/topic/148429-solved-cant-view-image-in-email/#findComment-779268 Share on other sites More sharing options...
contra10 Posted March 8, 2009 Author Share Posted March 8, 2009 if i go to the link the image shows but if i put that same code in the email or on the page it doesn't show Quote Link to comment https://forums.phpfreaks.com/topic/148429-solved-cant-view-image-in-email/#findComment-779272 Share on other sites More sharing options...
haku Posted March 8, 2009 Share Posted March 8, 2009 That's because localhost isn't an external domain name, it's only internal. So that will only ever show on your computer. Quote Link to comment https://forums.phpfreaks.com/topic/148429-solved-cant-view-image-in-email/#findComment-779524 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.