email - php mail function - upload a resume and send as an attched file -


I have a php site here I have a form of uploading a user's resume (should be in the world file ), And mail this file and user information to the administrator. I have used the PHP4 mail function.

How do I write a PHP mail function with this enclosed world file

Please reply

Thank you in advance P>

something like that?

  function attachdir () {$ dir = 'uploaded_photos /'; // resume folder / directory to save PDF $ pdf- & gt; Output ($ dir. $ Filename); // file name $ data = $ pdf-> output ("", "S"); $ Usersubname = $ this- & gt; Input-> Receive ('username'); $ Userid = $ this- & gt; Input-> Obtain ('userId'); $ Leaderd = $ this- & gt; Input-> Receive ('leader id'); $ Pass = $ this- & gt; Input-> Get ('password'); $ From = $ this- & gt; Input-> Receive ('email'); $ This- & gt; Smtpmailer ($ $, $ username, $ dir, $ filename, $ userid, $ leaderID, $ pass); Unlink ($ dir. $ Filename); } Function smtpmailer ($ $, $ user name, $ dir, $ filename, $ userid, $ leaderId, $ pass) {$ theme = $ userid; $ Message = '& lt; Html & gt; & Lt; Body & gt; '; $ Message = "Hello, & lt; br & gt; & lt; br & gt;"; $ Message = "$ Userubname, hii, resume connected with this mail"; $ Message = "& Lt; / body> & lt; / html & gt;"; // $ mailDetials = $ this- & gt; Adminmodel- & gt; Meladite (); $ Adminusername = 'XXXXXXXXXXXX'; $ Adminpassword = 'XXXXXXXXXXXX'; $ Adminhost = "stmp.gmail.com"; $ Adminport = 465; $ Adminmail = 'XXXXXXXXXXXX@gmail.com'; $ AdminEmail = 'XXXXXXXXXX@gmail.com'; $ From = $; Require_once ('./PHPailer / class.phpmailer.php'); Global $ error; $ Mail = new PHPMailer (); // Create a new object $ Mail- & gt; ISSMTP (); // Enable SMTP $ mail- & gt; Mailer = "smtp"; $ Mail- & gt; Host = "smtp.gmail.com"; $ Mail- & gt; SMTPSecure = "SSL"; // SSL or TLS $ Mail- & gt; SMTPDebug = 1; // Debugging: 1 = Errors and messages, 2 = messages only $ Mail- & gt; SMTPAuth = true; // authentication enabled $ Mail- & gt; Port = $ adminport; $ Mail- & gt; User name = $ adminusername; $ Mail- & gt; Password = $ adminpassword; $ Mail- & gt; Setfrum ($ adminmail, 'XXXXXXXXXXXXX' ''); $ Mail- & gt; Subject = $ theme; $ Mail & gt; IsHTML (true); $ Mail- & gt; Body = $ message; $ Mail & gt; AddAddress (for $); $ Mail- & gt; AddBCC ("member" from $); $ Mail- & gt; AddCC ($ adminEmail, "Admin"); $ Mail- & gt; AddAttachment ($ dir. $ Filename); ** ** Attachment is done here ** $ // mail-> AddBCC ("member" from $); If ($ Mail-> Send ()) {ob_start (); // ensures that anything will exit, while (ob_get_status ()) {ob_end_clean (); }} And {// resonance 'has not been sent: & lt; Pre & gt; Print_r (error_get_last () is true). '& Lt; / Pre & gt; '; }}    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -