PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I’m using phpMailer to send emails. The user is entering the mail info by using a web form. The attachment is taken from a file field. The attachment dose not attach on a client machine (it works on the server). Part of the coding is below.
$File =$_POST['filefield']; // path comes as “C:/test/file.txt”
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AddAttachment("$File");
Can you help me to run this on a client machine…..?
You can't run PHP code on a client machine... Are you looking to attach a file directly from the client's computer? You'll have to have the client upload the file through a <input type="file" .. /> and attach it from $_FILES.
Yes i want to the script to be running on a client machine and at the same time I’m using a <input type="file" .../> to get the attachment. Please be kind enough to show me how to get the path of the attachment by using the $_FILES. I’m bit confused in using it......