RE: [PHP-QA] Win32/mail stuff
| From: | Melvyn Sopacua | Date: | Tue, 04 Jun 2002 23:05:16 +0000 |
| Subject: | RE: [PHP-QA] Win32/mail stuff | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-5496@lists.php.net to get a copy of this message | ||
At 00:03 5-6-2002, Liz shared with all of us:
Possible, but, I found that windows wouldn't accept a To address of say "Liz Kimber <liz@xcalibur.co.uk>" so.. I had to force it with the extra headers..Ah - now we're getting there. So 4.1.2 doesn't have RFC-825 support for the to mail argument - I haven't verified that yet. What I do have verified, is that if the address is in the 'to' argument is the same as the To: header in the extra headers, it will accept RFC-825-style addresses and will delete the To: header, so my statement before wasn't entirely correct - the email addresses should match. Test case: $ cat 002toheader.php <?php $settings = array( ini_get('SMTP'), ini_get('smtp_port')); print('Settings:'); var_dump($settings); print( "\n\n"); $mail = array(
'to' => 'mdev@idg.nl',
'subject' => 'Test w32 mail',
'body' => 'This is a test',
'extra' => 'To: Melvyn Sopacua <mdev@idg.nl>'
);
var_dump($mail);
$ok = mail($mail['to'], $mail['subject'], $mail['body'], $mail['extra']);
if(!$ok)
{
print($php_errormsg);} else {
print("\nOK\n");
}
?>
Oh, and the code used could have been a full domainised name, ie use liz@xcalibur.co.uk for all of them (bar one from work which wouldn't have worked as it would have to be marlborough stirling) and it would still produce the same results - I promise.So the above script wouldn't work - would work on 4.3.0-dev. Are you able to compile php yourself? The code changes are in win32/sendmail.c and I from the looks of it, it's isolated enough to patch that file against current sources and recompile 4.1.2. That would save you, for the time between your project going live and 4.3.0 release and would be another strong argument for promoting php in your company: 'Look - cause I have the source, I can fix my own problem, instead of going through M$ support'. Markus - could you confirm if patching win32/sendmail.c is enough for this or whether other changes are necessary?
Hence, Ive always coded all my systems like it.. And ive seen many a web page saying this was the way to go, thus I really wanted you guys to make it the same all round for unix and windows. I still havent quite worked out why it should be different for unix and windows,Basically, because mail() started as a sendmail fork on *nix and sendmail.exe for windows is not free.
OK unix *CAN* run sendmail direct, but, why not just use the SMTP port and make it the same for everyone, reduces code, simplifies all issues etc.There is an overhead, for a socket dialogue vs. shell spawn with arguments and content on stdin.
If the mail commands' to address can now take "liz Kimber <liz@xcalibur.co.uk>", its probably best to make a big statement.. I agree multiple To addresses are probably correct, but, if the example given was the case I wouldn't expect to see a "liz@xcalibur.co.uk;God" coz God's Email is liz@xcalibur.co.uk it should be recognised as one person..You're correct - as said above.
If I had a windows compiler, Id look at fixing the windows side, I have this 1 p400 I can butcher to my hearts content - actually its my main dev box but I can mess with it within reason. And, personally, the last piece of software I want on it, is visual studio big fat ugly system that it is.. make it compatible with borlands.. I'll try it.Oh - so you can't - if Markus confirms, I can do this for you.
Im just tired as I have spent a year writing the purchasing requirement system only to have PHP 4.2.0 break it and now get into a war over whos problem it is, Im trying to prove a point to a (sadly) a company in the top 3 (it might even be first now) in its area, that MS isnt the answer to life the universe and everything. Im not employed there any longer as a programmer but a tech support guy/girl, so Im not really employed for it, nor given any thanks for it. The system was thought of by my bosses boss as a whim, and brought into reality by me and only me. Im fed up with it, and all the crap Ive had to go with it, (one person is strongly against it because she didn't think of it and has put every hurdle in my way she can).miau - hate when that happens - not mocking - just trying to cheer you up a bit.
So, if you're telling me, I need to write every mail command in my projects, I'll probably cry, but fine.. as long as I know they will work!Nope - I think the suggested fix-source code would work best - now we just need to assure, that php-4.3.0 release+, doesn't break that and you will be fine from that point on. Met vriendelijke groeten / With kind regards, IDG.nl Melvyn Sopacua Webmaster