Fork me on GitHub

pe_pplog demo page

Main menu

Help with the mail, please!

Fixing the contact script.

I got a lot of comments from people like me, who don't have sendmail installed.

In the current version mail is send with the following code:


open (MAIL,"|/usr/lib/sendmail -t");
print MAIL "To: $config_sendMailWithNewCommentMail\n";
print MAIL "From: $email, \t $author \n";
print MAIL "Subject: $title\n\n";
print MAIL "$message ";
close(MAIL);



Obviously this only works for people who have sendmail installed at /usr/lib/sendmail. In the new version I want to the user to be able to choose which program to use in the config file:

@config_sendMailWithNewCommentMail
=('/usr/lib/sendmail -t','example@email.com');

Thus the code becomes:
open (MAIL,"|$config_sendMailWithNewCommentMail[0]");
print MAIL "To: $config_sendMailWithNewCommentMail[1]\n";
print MAIL "From: $email, \t $author \n";
print MAIL "Subject: $title\n\n";
print MAIL "$message ";
close(MAIL);


I don't have sendmail or the like installed, so if any one can tell me if this makes sense, that would be nice.
I added the option for people like me to have the messages stored locally and read inside the admin page of the blog, by putting 'local' instead of a path.
Posted on - Categories: changes


Comments:

test   Posted on 3 Dec 2013, 12:04 by bk
this is a test post
second line
third line





Add Comment