mwurster
Goto Top

PHP mail() Funktion kann nicht über Exchange versenden.

Hi, ich versuche über die mail() function eine eMailüber meinen lokalen Exchange 2003 zu versenden. Ihr könnt das Ergebnis hier anschauen:

http://www.tec-on.com/test.php

hier seht ihr den Fehler:


Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\Inetpub\wwwroot\test.php on line 3

Woran könnte das liegen und wie kann ich das lösen?

Ich nehme an, dass der SMTP Connector von Exchange keine anonymen Anfragen standardmässig annimmt. Jetzt stellt sich die Frage, wie kann ich das ändern, so dass ich auch mit der mail() Funktion von PHP eMails über meinen eMail - Server versenden kann?

Vielen Dank im Voraus.

Gruß Maik

Content-Key: 5630

Url: https://administrator.de/contentid/5630

Printed on: April 23, 2024 at 21:04 o'clock

Member: linkit
linkit Jan 14, 2005 at 18:16:48 (UTC)
Goto Top
http://dev.portalzine.de/displayarticle159.html

*

Found this at PHP Everywhere:

It's easy to send email from PHP on Windows with PHP's built-in Mail function. All you need is an SMTP mail server to send to.

Installation
Modify the [mail function] section of the PHP.INI file which should now be residing in your C:WINDOWS directory. For example, assuming you had an e-mail address at me@myaddress.com and the SMTP server that you normally configure your e-mail clients to use to send e-mail is smtp.server.com, you would change that section of PHP.INI to read:

[mail function]
SMTP = smtp.server.com ; for win32 only
sendmail_from = me@myaddress.com ; for win32 only
;sendmail_path = ;for unix only, may supply arguments as well ; (default is sendmail -t)

The test string I used to make sure my example worked:
<?php
print mail ('johnlim@natsoft.com.my',
'No need for reply -- PHP test!', /* subject */
"hi JohnnLine 2n"); /* body */
?>

*

SMTP function for Exchange inside pnAPI.php done ! (Score: 1)
by duns (duns@portalzine.de) on Feb 27, 2003 - 09:15
(User info | Send a message) http://duns-ground.fr.st
Hi,

Strange thing indeed, we have developped a transformed version of pnapi.php pnmail function to handle smtp on win32 platform...

The fact is that using php.ini to access smtp is sometimes not working on win32 smtp server.

We have validated the solution on Microsoft Exchange Internet Mail Service Version 5.5.2653.13
(NT Domain behind MS proxy connected to an ADSL Route with NAT/PAT functions)...

And it works !

In fact we have taken a part of phpBB2 smtp function and integrated it inside PN.

This solution is actualy a hack with no form integration inside postnuke: i suggest to integrate it and be able to configure it from preferences admin panel... (but i don't know how to this : we need a check box e.g. : win32 smtp mailer yes/no and 3 areas : server ip account and optionally (no need on our configuration) password to have a full integration into the core.

What we have modified :
The pnmail now could handle standard postnuke mail function OR smtp win32 mode for the same function (especially working with MS Exchange server). The changes to %windir%php.ini are no more required : it's the reason why i post here : pn could integrate itself the good method to handle this type of operation !

The files (modified includes/pnapi.php and a new one includes/smtp.email.php) for pn phoenix (0.723) are available if you need it just ask for it here or here

You could also come to www.dunslab.net
and ask for it to the webmaster...
(this comment will be posted on main news page)

I think someone experienced with PNCore (MagicX ?) integration could probably take a look at it to integrate it on the CVS...

Regards to all Pnukers !
DuNs AKA Denis Villechalane
Webmaster of DunsLab.Net
Member: mwurster
mwurster Jan 14, 2005 at 18:47:28 (UTC)
Goto Top
Hi,
sorry, eine alternative Funktion kann ich leider nicht einsetzen, da ich dann das OpenSource Projekt das ich einsetze komplett umschreiben muss. Das kann ich leider schon aus zeitlichen Gründen nicht. Daher wäre es klasse, wenn mir jemand helfen könnte die mail() Funktion mit dem normalen Exchange zum laufen zu bekommen.

Danke schonmal und Gruß Maik
Member: scan5416
scan5416 Apr 27, 2009 at 22:53:08 (UTC)
Goto Top
Hi,

Ich schreibe jetzt das einfach mal, habe den englischen Text nich ganz verstanden. oder evt. verstehe ich etwas Grundlegendes nicht.

Aber die Funktion mail() hat ja nicht mit deinem Exchange Server am Hut. Du kannst ganz einfach über die mail() Funktion eine Mail versenden.

http://ie.php.net/manual/de/function.mail.php

Wenn ich da etwas falsch verstanden habe, dann möchte ich mich für meine nutzlosen Post entschuldigen. Aber ich habe bis jetzt meine Mails immer über diese Funktion versendet und es währe mir neu wänn die etwas mit einem Exchange zu tun hat.

Gruss

Scan