Jump to content

Email Photos From Website


darphas

Recommended Posts

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..

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.