I am totally new to PHP scripting. This might be a silly question hope someone could help.
I try to write a script that can send an attachment to specified destination using php. I found many recommend pear mail. Like the first answer in
Send email using the GMail SMTP server from a PHP page
I tried to download the pear mail tar.gz file and extract to my desktop (I am running the script in windows environment). I installed php using the .msi windows installer from php.net website, I'm editing and running the php script using netbeans. when I call the following functions, I can only see the first echo and the system says "done".
function mailer() {
echo "1" . "\n";
require_once "C:/Users/ll/Desktop/Mail-1.2.0/Mail.php";
echo "2" . "\n";
}
Obviously something wrong happened in the require_once line. But I don't really know what is going wrong. I am familiar with java, when something wrong happens the output console will display a long list of stacktrace and exceptions encountered, but for php, the program just end quietly with entire output being
C:\Program Files (x86)\PHP\php.exe C:\Users\ll\Documents\NetBeansProjects\FTPAutomation\index.php
1
Done.
I read other threads talking about installing pear mail. I did not have any install packages but just the unzipped folder, and I am assuming all I need to do is just include the full path of the file Mail.php, the compiler will find the file and include it like we include .jar file for java program. Can someone point out what I am missing or what I did wrongly? Thanks a lot!