John-Paul Stewart <jpstewart@binaryfoundry.ca> wrote:
> Mauricio Asenjo wrote:
>>
>> For sending mail with custom headers, I modified a phpmailer
> > class for php to do that , maybe it can be used in cgi mode
> > on a shell script.
>
> I don't think the OP would want to run a PHP script in CGI mode since
> PHP can be used directly for scripting. On Debian systems it's in the
> php4-cli and/or php5-cli packages (other distros may have similar
> packages). If building PHP from scratch, simply pass --enable-cli to
> the configure script. For more info on command-line PHP, see:
>
> http://www.php.net/manual/en/features.commandline.php
>
That's what I meant! I'm sorry, I've got the word wrong but I was thinking abut that :-)
> Moreover, with PHP there's no need for a modified phpmailer class to
> send extra headers. The prototype for the PHP mail() function is:
>
> bool mail ( string to, string subject, string message [, string
> additional_headers [, string additional_parameters]] )
>
> Notice that the optional fourth parameter allows one to easily set extra
> headers.
>
> http://www.php.net/manual/en/function.mail.php
>
> Depending on the OP's needs, he could either write a simple PHP script
> to just do the mailing or redo the entire existing shell script in PHP.
>
>
That' right, but, Can this function be used with an external smtp server? I had to change some scripts once because I didn't figure out how to use mail() with a smtp server (the online manual mentions smtp server support only on windows platforms) and the php scripts we were using generated their own mail headers, so we decided to use phpmailer but we modified it a bit so it can accept custom headers . If it is posible tu use mail() with an external smtp server (with autentication), then I better get rid of phpmailer to keep things simple.