Avatar of john80988
john80988
 asked on

add email attachment in smarty template and phpmailer

my site have a email script which have few file to perform a simple contact form submit, i suft the net but no clue on now to make it send theattachment, my eye was blur, experts please help.

2 html + 1 php file script as below

one is html file to display the form

<form name="contactusForm" enctype="multipart/form-data" action="{$url_https}p=contact_us" method="post" onsubmit="return CheckContactusForm(this)">            
....
<div class="field clearfix">
                        <label>Upload</label>
                        <input name="form[upload]" type="file" id="upload" />
</div>
...

one is php file to perform the sending script

function emailSupport($contact){
      global $settings;

      view()->assign("fname", $contact["fname"]);
      view()->assign("subject", $contact["subject"]);
      view()->assign("message", $contact["message"]);
        view()->assign("email"=>$contactus["email"], "name" => $contact["fname"]);
      send_mail("name@somename.com","Customer Inquiry",$message,$from, "html");
}
PHP

Avatar of undefined
Last Comment
Robert Saylor

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Robert Saylor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck