» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2006, 01:33 PM
illingworth illingworth is offline
Junior Member
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
illingworth is on a distinguished road
Default How to attach image in email

Hi there!

Can anyone tell me, how to attach an image in mail using php. i want to send email with some information and 1 image as an attachment when click on the submit button. and images upload script already worked and to upload images in server one folder that folder name is attach.which images upload script are given follow which i will that script. plz send ur suggestion in this regard, ur replies will be highly appreciated,

if(isset($pImage)){

//echo "File Name: ".$pImage;
//echo "<br>File Temp Name: ".$_FILES['upload']['tmp_name'];
//echo "<br>File Size: ".$_FILES['upload']['size'];
//echo "<br>File Type: ".$_FILES['upload']['type'];
if($_FILES['upload']['size']<(50*1024)){
if(isset($pImage)){
$path="Attach/";
$arrImg=explode('.',$_FILES['upload']['name']);
copy($_FILES['upload']['tmp_name'],$path.$pImage); -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-15-2006, 01:37 PM
yamen yamen is offline
OSP Starters
 
Join Date: Jun 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
yamen is on a distinguished road
Lightbulb

I don't this would fully solve your problem but you can try this code

<?php
$fileatt = ""; // Path to the file
$fileatt_type = "application/octet-stream"; // File Type
$fileatt_name = ""; // Filename that will be used for the file as the attachment

$email_from = ""; // Who the email is from
$email_subject = ""; // The Subject of the email
$email_message = ""; // Message that the email has in it

$email_to = ""; // Who the email is too

$headers = "From: ".$email_from;

$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\&quo -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Rider Launches Web-Based Email 4.0 outsourcingplans Web Hosting News 0 11-23-2006 02:49 AM
Grand Canyon Domains Launches Web-Based Email 4.0 outsourcingplans Web Hosting Industry 0 05-09-2006 08:19 PM
Privacy Networks Launches Email Integrity Suite outsourcingplans Web Hosting Industry 0 02-08-2006 06:24 PM
Ask Jeeves Launches Proprietary Image Search Technology outsourcingplans Web Hosting Industry 0 01-26-2006 07:05 PM
Rockliffe Reduces Complexity of Wireless Email outsourcingplans Web Hosting News 0 12-27-2005 02:29 PM


All times are GMT. The time now is 02:22 PM.