Greetings,
I am running Framecal in the background on my home computer (winxp apache).
These newer
computers with a broadband connection make these sort of things possible.
The only problem
I had with Framecal was email. The mail-lib-win.pl is designed to work with Blat 1.7.
That, while serviceable, is a bit out of date. I already run Blat 2.2.2. There are a few syntax problems.
Also there is no longer a need to create a temp file. Below you will find 3 items.
One, a way to modify the original mail-lib.pl to work with the current version of Blat.
Two, a new mail-lib.pl that will work without creating a temp file.
Three, a way to install Blat for a typical home user. Your install may vary, make sure to read the Blat Docs.
1.*****
Below is the second line from the original mail-lib.pl.
my($from, $to, $subject, $messagebody) = @_;
Change it to read:
my($to, $from, $subject, $message) = @_;
Notice the only change, the reversal of $from and $to.
2.*****
Below is a new mail-lib.pl,
###################################################
sub send_mail {
my($to, $from, $subject, $message) = @_;
my($mail_program, $blat_string);
$mail_program = "C:/apache/cgi-bin/blat.exe"; #location of blat change if needed
$mail_program =~ s/\//\\/g;
$blat_string = "- -t $to -i $from -s \"$subject\" -body \"$message\" -q ";
system ("$mail_program", "$blat_string");
}
1;
###################################################
3.*****
The first thing we need to do is install Blat. There are many different
versions of blat, we want Blat v2.2.2 full. You can download it from Sourceforge.net
It's about 100k in size. The only file you will need from the
download package is blat.exe.
Place it in your cgi-bin folder.
If you want to keep it in another location you can.
Change the sub send_mail to reflect it's location.
Below are instructions for installing blat.
Now open up a console, command prompt, or what some versions of
windows call a ms-dos prompt. Then change to the folder where you installed blat.
For me it goes like this;
cd\ (press enter) # now in root directory
cd apache (press enter) # now in apache directory
cd cgi-bin (press enter) #now in cgi-bin
Now check to see if blat is OK by typing blat and then press the enter key.
If it reads Blat yadda yadda yadda all is well.
If not you are in the wrong folder.
Now install the preset values for blat.
This will allow for simple authentication, this is
necessary to get past the spam filters.
If your isp has a odd setup, like other then port
25 for email you will have to change this.
See the doc file that came with blat. Type the
following exactly, including the spaces.
blat -install smtp.your.isp [email protected] - - - yourloginname yourpassword (press enter)
Let's check blat to make sure it works. Send a email to a yahoo or
hotmail account. Any place other then your ISP.
First we will send a simple email, then one with a attachment.
Type;
blat - -to someplace.com -subject test -body yadda (press enter)
Now with a file, first create a new file with notepad, it can be empty,
and place it in your cgi-bin. Name it test.txt
Now type;
blat test.txt -to someplace.com -subject filetest (press enter)
Ok, check your email, where you sent these two test emails,
if both are there you are done.
***********************************************************
A small amount of time went by and I added the following.
Greetings,
Thanks for the emails, always nice to hear from other
Framecal users. Two people reminded me that it would
be a good idea to address the fc_remind.pl issues.
This is the last thing that needs to be done for email
on the windows platform.
Open fc_remind.pl in your favorite text editor and
configure the location section. I'm using Apache so mine
looks like this:
my( $abs_path ) = "C:/apache/cgi-bin/calender";
my( $file_loc ) = shift( @ARGV );
$file_loc = "framecal/$file_loc";
my( $lib ) = "libs";
Then the days ahead to remind:
my( @num_days ) = ( 1, 7 );
This is the default setting. Nothing else needs to be
set or changed in fc_remind.pl. Yes, I know calendar
is misspelled.
Now we need a few calendar items to be reminded of.
So open up framecal in your browser and set a few dates.
At this point it would be logical to simply set Scheduled
Tasks to run fc_remind.pl once a day. Windows will not
(for me) work that way. To test fc_remind.pl open up a
command prompt (console) and type;
fc_remind demo
(demo is the name of my test calendar) and press the
enter key. Notepad will open and display the text of
fc_remind.pl. This is not what we want.
To change fc_remind.pl to something windows will run
properly we need to change it to a batch file. The tool
to do this is included in your distribution of Perl.
pl2.bat.bat will be found in one of your perl/bin folders.
The location changes from distro to distro, you will have
to search for it. After you find it copy pl2bat.bat to the
folder with fc_remind.pl in it,
.
Make a copy of fc_remind.pl for backup in case something
goes wrong.
In the command prompt type;
pl2bat fc_remind.pl
then press the enter key. This will create a new file
called fc_remind.bat. Rename fc_remind.pl to something
like orignal_fc_remind.pl to avoid confusion.
Now, in the prompt type;
fc_remind demo
and press the enter key. If all goes well your reminder
emails will now be sent.
If you see a error message such as file such and such
not found in the console don't panic. This simply means
that you did not follow the recommended file structure
for framecal. If you like you can change the perl code
in fc_remind.bat to reflect the changes you made. Or you
can just add what is missing. If it can't find for example
c:/apache/someplacewierd/libs/mail-lib.pl simply make another
copy of mail-lib.pl and place it where it want's it.
Now we want to use Scheduled Tasks (winxp) to automate the
sending of the reminder emails. Click, start > Programs >
Accessories > System Tools > Scheduled Tasks and the
Scheduled Tasks screen will open.
Before we add the remind.bat task you may have the same
problem I had. Scheduled Task would not accept a password.
Because of this the Task would fail to execute. I found a
fix to let me run ST without a password at
Kellys Korner
number 67.
After I ran this vbs script I needed to reboot
my computer
then all ran well.
Double click on Add Scheduled Task and the Wizard will
open. Click the next button. Depending on how many
applications you have installed it will take a while to
open the click the programme you want screen. Now click on
the Browse button. And negotiate to the fc_remind.bat file.
Double click on it. This will take you to the name screen
and when to perform task. Set it to Daily. Click next.
Pick a start time and tick Every Day. Click next. Leave
what ever user name is shown. Leave the password fields
empty. Click next. Tick Open Advanced ... box and click
Finish. Under run, at the end of the sequence, add a space
the name of your calendar (demo). Click on the settings
tab and set Stop task to something like ten minutes. Click
the Apply button and then OK on the Set Account Information
screen. Then Click Ok to close the wizard.
To test the task right click on whatever you named it and
select run from the drop down menu. A empty prompt will
open and stay open un till it is through sending the email.
You can now delete the backup copy of fc_remind.pl.
Between this and my first post, Blat 2.2.2, Framecal
should be fully functional on the windows platform.
That's it. Your done.
[email protected]