Runner_Mail() | PHPMailer() | PHP Mail() |
SMTP, user name, password, port, etc. are set inside the PHPRunner UI | PHPMailer() is called by Runner_Mail()
SMTP is set inside the PHP code itself |
SMTP is set in “PHP.ini” |
<?php
require_once(“include/dbcommon.php”);
$email = “t1@mobitek.my”; $msg = “”; $subject = “New data record”;
$msg.= “Message: [Message]\r\n”; $msg.= “Recipient: Recipient\r\n”; $msg.= “Date/Time: DateTimeQueue\r\n”; runner_mail(array(‘to’ => ‘$email’, ‘subject’ => $subject, ‘body’ => $msg)); ?> |
<?php include_once(‘libs/phpmailer/class.phpmailer.php’); include_once(‘libs/phpmailer/class.smtp.php’);$mail = new PHPMailer( true ); // Mail settings $mail->isSMTP(); //Send using SMTP $mail->Host = ‘mail.sweetco.com.my’; //Set the SMTP server to send through $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = ‘factory@sweetco.com.my‘; //SMTP username $mail->Password = ‘2022@Beranang@Factory’; //SMTP password //$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption $mail->Port = 587; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` $mail->setFrom(‘support@mobitek.my‘, ‘MOBITEK Support’); $mail->isHTML(false);$mail->To = “t1@mobitek.my”; $mail->Subject = “This is Subject”; $mail->Body = “This the body”; $mail->Send();?> |
Open “php.ini” and search for “smtp” (there are no entries for no username and password)
[mail function] ; For Win32 only. ; For Unix only. You may supply arguments as well (default: “sendmail -t -i”). ; Force the addition of the specified parameters to be passed as extra parameters ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename ; The path to a log file that will log all mail() calls. Log entries include |
Category Archives: PHPRunner
How to Implement Log-In Page using “Database” for a Web Application
- Edit “Email settings…” in “Misc” tab.
- Add new table “users” in “Security” tab.
- Set “Dynamic permissions” in “Security” tab. Add a new user.
- Build and run the PHPRunner project in localhost. Log in using the username and password added previously. Let the PHPRunner project open in localhost.
- Go to PHPRunner project again. Enable “Password hashing (encryption)” in “Registration and passwords…”.
- Build and run PHPRunner project again in localhost.
- Go to “Admin Area”.
- Go to “Add/Edit users”, edit the password. To use back the same password, first change the password to another password. Save it and then edit it back to change to the original password.
PHPRunner Allows Both Image and PDF File to be Uploaded
The Preferred Method — “View as File”
To set the field to allow both image and PDF file to be uploaded, go to “Designer” tab, select the field and click “View As/Edit As” button:
- In “View as”, set the field as “File”
- In “Edit as”:-
In “Advanced Settings”, set the “Allowed file types” to accept both image and document format or just leave it empty to allow all file formats:-
- The result:-
Difference Among “view as image”, “view as file”, “view as PDF”
View as “Image”
View as “File”
View as “PDF”
Conclusions on Both Image and PDF File Format
In the documentation (https://xlinesoft.com/phprunner/docs/view_as_settings_file.htm), there is “Display PDF files online” but not in our PHPRunner.
That’s the only way to view the PDF file uploaded online. But still the image file will be downloaded when clicked.
3 ways to show the uploaded image or file
4 Types of List Box or Drop Down Box in PHPRunner
Conclusion: there are 4 types of list box or drop down box in PHPRunner:-
- Edit box with AJAX popup — linked with a table and allow user to input own text
- Dropdown box linked with a table
- List page with search
- Dropdown box with list of values (does not link with a table)
The Difference Between “List Page” and “View Page”
These are the web pages available:-
The difference between “List Page” and View Page”:-
LIST | VIEW |
https://xlinesoft.com/phprunner/docs/list_page_settings.htm A page that shows the table records and the buttons to work with these records. |
https://xlinesoft.com/phprunner/docs/choose_pages_screen.htm A page that shows the selected record only, without the additional buttons. |
https://xlinesoft.com/phprunner/docs/insert-standard-button.htm#list_page Functionality for List Page
|
https://xlinesoft.com/phprunner/docs/insert-standard-button.htm#view_page Functionality for View Page
|
Using phpMyAdmin is Better than PHPRunner for Database Modification
Different Grid Type in PHPRunner
Renaming Column Name will Affect PHPRunner
If column name is renamed via PHPMyAdmin or PHPRunner, the records will be missing from the list page (tellow table) despite there are 3528 records:-
The following solutions DOES NOT work:-
- Remove all fields in stock card’s list page and add them all again.
- Delete current list page and add a new list page.
- Remove the table and add it again.
The only solution is to re-build the PHP project from scratch.
The possible root cause is the PHP project was built using old version (e.g. version 10.3) or trial version of PHPRunner. Then column name is renamed in the new version of PHPRunner, e.g. version 10.4.
How Does PHPRunner Label the Column Name in UI of PHP (List Page)
How to Rename “List” in PHPRunner
There are 3 places that need to modify:
- Custom views table
- Top menu
- Landing page menu (no need to modify if this is removed)