User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 423,579 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,410 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 608 | Replies: 6
Reply
Join Date: Feb 2008
Posts: 298
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

absolute paths

  #1  
Apr 21st, 2008
i am trying to send out an email which contains images from a database of images that have been uploaded. when i send the email out only the text and any images that have been hard codeing in using the img tag.

i have done some research on this and i have found out that i need to display the images using the absolute path to them but i do not know how to do this.

i found some code to print out the absolute path to where the images is being dstored in the database but how do i then use this path to display the images within the email?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation: trudge is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: absolute paths

  #2  
Apr 21st, 2008
You can't 'display' an image in an email. You can however attach a file to an email and send that. However that is not a MySQL topic. You would be better in a forum for the language you are using to do this in.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Feb 2008
Posts: 298
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: absolute paths

  #3  
Apr 21st, 2008
it is possible to display images in an email i have already got some of them to display on the email that is being sent out but none of the images from the databases will display within the email.

to gat images to display within the email then the absolute paths must be used for the images and they will display. to get an image to display using the absolute path the the code looks some thing like this

www.yourdomain.com/images/image1.jpg

i have used this code to get the absolute path of the images bing stored in the database

$path = getcwd();
echo "The absolute path to this directory is: ";
echo $path;

and this prints out the absolute path to the directory where the mysql table is stored i now need to know how to use this path to get the images to display from the server when the email is sent out.
Last edited by kevin wood : Apr 21st, 2008 at 6:53 am.
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation: trudge is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: absolute paths

  #4  
Apr 21st, 2008
Originally Posted by kevin wood View Post
it is possible to display images in an email i have already got some of them to display on the email that is being sent out but none of the images from the databases will display within the email.

to gat images to display within the email then the absolute paths must be used for the images and they will display. to get an image to display using the absolute path the the code looks some thing like this

www.yourdomain.com/images/image1.jpg

i have used this code to get the absolute path of the images bing stored in the database

$path = getcwd();
echo "The absolute path to this directory is: ";
echo $path;

and this prints out the absolute path to the directory where the mysql table is stored i now need to know how to use this path to get the images to display from the server when the email is sent out.


You are correct. In this case the message has to be sent as HTML.
Use
Content-Type: multipart/mixed;
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Feb 2008
Posts: 298
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: absolute paths

  #5  
Apr 21st, 2008
this is were my problem lies though. i have been able to hard code images in to the html code and send this out as an email newsletter but when the images from the database are used they do not show up on the email.

i have set the page up once with all the images coded in using the img tag and it works i need to be able to recall the images from the database and send them out in the email with the absolute path attached to them so that when the email is opened it knows to look on the server were they are held to retrieve the image and display it correctly in the email.
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation: trudge is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: absolute paths

  #6  
Apr 21st, 2008
In order for your images to be available via a web link, they have to be in the 'public' tree of your web server. Think of where you put images to be displayed on a web site. The images you want to send in the email have to be under that same tree.

But this isn't really a MySQL question. It is more of a server / CGI question.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Feb 2008
Posts: 298
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: absolute paths

  #7  
Apr 22nd, 2008
thanks for the help.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 7:29 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC