whoknows361
Technical User
hello - I followed your advice and got phpmailer - however as a newbie to php I need more assistance.
I am using the following php code to upload a graphic file to my server and following it with the phpmailer code to send an email - so my php script looks likes this:
Now on the attachment line in the phpmailer code it shows:
$mail->AddAttachment("/var/tmp/file.tar.gz");
But I need to change this to the image file which was identified in the first few lines.. How do I do this?
How can I reference the image file?
Your help is GREATLY appreciated.
Jonathan
I am using the following php code to upload a graphic file to my server and following it with the phpmailer code to send an email - so my php script looks likes this:
Code:
//move the uploaded file
move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']);
chmod("./files/".$_FILES['Filedata']['name'], 0777);
$mail = new PHPMailer();
$mail->From = "whoknows361@msn.com";
$mail->FromName = "Jon";
$mail->AddAddress("myemail@myemail.com","Jonathan");
$mail->AddReplyTo("myemail@myemail.com","Jonathan");
$mail->WordWrap = 50; // set word wrap
$mail->AddAttachment("/var/tmp/file.tar.gz");
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the <b>HTML body</b>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
Now on the attachment line in the phpmailer code it shows:
$mail->AddAttachment("/var/tmp/file.tar.gz");
But I need to change this to the image file which was identified in the first few lines.. How do I do this?
How can I reference the image file?
Your help is GREATLY appreciated.
Jonathan