Jump to content
Larry Ullman's Book Forums

Jai

Members
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Jai

  • Rank
    Member
  1. Thank you Mr. Larry! I look forward to your effortless e-commerce book. I most say i like the way you put the explanation in your books, that's one of the reasons i decided to ask this question in this forum. Yours sincerely, Jai.
  2. I have studied php introduction and php advanced object oriented programming, Was able to get my hands on small projects such as building small websites, Buiding forums. I will like to know which project book is the best php project book guide to guide developers on building dynamic applications(such as social media platforms, educational platform, online libraries...etc) using php. Which is the best with detail and straight forward explanation.
  3. I figured out.. that to use phpmailer, the class had to be defined first(i.e. immediately after the opening php tag) before any line of code. The mistake i did when trying to use it before was; i included the class only within the body of my script when the code for the message section was written which then threw the exception (UNCAUGHT ERROR ;PHPMAILER CLASS NOT FOUND). So in order to use the phpmailer to send email from a particular script, I did as this: <?php //define the phpmailer class use PHPMAILER\PHPMAILER\PHPMAILER; use PHPMAILER\PHPMAILER\Exception; /* here comes the code for the script, for instance including a script, validating the form, checking if the form has been submitted, submitting and whatever.. */ /* After wriiting all the codes above, the section of code which should send the mail is the phpmailer body with my credentials for authentication. */ require 'absolute path to the autoload.php file'; $mail = new PHPMailer(TRUE); try { $mail->setFrom('email@example.com', 'optional'); $mail->addAddress($trimmed['email'], $trimmed['first_name']); $mail->Subject = 'Subject'; $mail->Body = $body(comes from the lines of codes written above before this section of codes); /* SMTP parameters. */ /* Tells PHPMailer to use SMTP. */ $mail->isSMTP(); /* SMTP server address. */ $mail->Host = 'smtp.gmail.com'; /* Use SMTP authentication. */ $mail->SMTPAuth = TRUE; /* Set the encryption system. */ $mail->SMTPSecure = 'tls'; /* SMTP authentication username. */ $mail->Username = 'email address to be use to send the mail to other email addresses'; /* SMTP authentication password. */ $mail->Password = 'password of email address used to send the mail to other email addresses'; /* Set the SMTP port. */ $mail->Port = 587; /* Finally send the mail. */ $mail->send(); } catch (Exception $e) { echo $e->errorMessage(); } catch (\Exception $e) { echo $e->getMessage(); } // finish the page echo '<h3>A message to confirm that the mail was sent.</h3>'; include('includes/footer.html'); exit(); NOTE: I HAD TO TURN ON LESS SECURE APPS PERMISSION FOR THE GMAIL ACCOUNT WHICH IS USED TO SEND EMAILS TO OTHER EMAIL ADDRESSES. NOT TURNING ON LESS SECURE APPS FOR THE RECIPIENTS ACCOUNT
  4. Necuima, I finally succeeded in using PHPmailer, i ll find a day to post about the success. Thank you Yours sincerely, Jai.
  5. Hello, i have been studying this book "php 6 and mysql 5 for dynamic website" on my own... i am happy i finished studying this book and this gave me an advanced basic understanding in PHP and MYSQL. Please i will like some recommendations on which php and mysql book to study/buy next in order to have more advanced knowledge in php and mysql. So as to be able to create a section in my web application to read pdf files. And also to be able to create an e-commerce application. Thank you, Jai.
  6. Hi Necuima, thank you i did check the link and it redirects to a page that suggest i should turn off "less secure apps" in my google account which i did quite well but still turns out i am not able to send mail. Thank you, Jai.
  7. Hi Necuima! i have been able to do the installation of phpmailer and put my credentials successfully, but when i run the script on my browser, i have this resulting Please could you explain what it really means because i turned of the 'less secure app' in my google account but i still couldn't receive any message. Thanks Jai.
  8. Ok, Please after creating the phpmailer file as describe above, where do I include the file? is it possible for me to include this in the php script which i have created to send the mail, the user who wants to login?
  9. During the installation of the composer, there is an option that state "use a proxy server to connect to the internet". Could this please have something to do with sending the mail to ? As for now i am doing without it.
×
×
  • Create New...