Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Email Photos From Website

$
0
0

Hi, i have a catalog that display 6 pictures in every item.. sometimes i need to send a specific photho from the item very quickly.. but i cant i tried everthing.. the process that i do is download the image and send it in outlook.. and thats very very low process!

 

 

i try this code.

 

 

Config

 

 

 
mysql_query( "SELECT photo_caption,photo_description,photo_code,photo_filename,photo_filename2,photo_filename3,photo_filename4,photo_filename5,photo_filename6,photos FROM gallery_photos WHERE photo_id='".addslashes($pid)."'" );
list($photo_caption,$photo_description,$photo_code,$photo_filename,$photo_filename2,$photo_filename3,$photo_filename4,$photo_filename5,$photo_filename6,$photos) = mysql_fetch_array( $result );
<?php 

include_once('./phpMailer_v2.3/class.phpmailer.php'); 

$mail             = new PHPMailer(); // defaults to using php "mail()" 
$body             = "<body><img src='".$images_dir."/".$photo_filename."'></body>"; 

$mail->From       = "name@yourdomain.com"; 
$mail->FromName   = "First Last"; 
$mail->Subject    = "Test Subject via mail()"; 
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test 
$mail->MsgHTML($body); 

$mail->AddAddress("whoto@otherdomain.com", "John Philips"); 
//$mail->AddAttachment("images/phpmailer.gif");             // attachment 

if(!$mail->Send()) { 
  echo "Mailer Error: " . $mail->ErrorInfo; 
} else { 
  echo "Message sent!"; 
}
?>

i;m newbie in php i try some crazy things only if works but no all the time..

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles