XMailforum is a readonly knowledge archive now.

Registering as a new user or answering posts is not possible anymore.

Might the force be with you, to find here what you are looking for.

2019-09-20 - hschneider, Admin

Cookie Disclaimer: This forum uses only essential, anonymous session cookies (xmailforum*), nothing to be scared of.

XMail Forum -> Problems sending with PHP mail()

Closed TopicStart new topicStart Poll

> Problems sending with PHP mail(), mail() does not work ...
Nuclear-Ping
Posted: Apr 28 2004, 08:49 PM
Quote Post


Newbie
*

Group: Members
Posts: 21
Member No.: 1087
Joined: 28-April 04



Hi all,

I'm new to XMail and was able to successfully set it up the last 5 hours and it works now very very good, SMTP with SMTP-Auth and POP do their service fine. smile.gif

But the only problem I have left is that I cannot send mails using the PHP mail () function. It tells me no error but also no mails ever arrive. I already used the XQM, the que is empty and all other Mails I sent (for example with Outlook) arrive immediately and when I send mails to the server they also arrive immediately. But PHP loose them somewhere ... somehow ...

Our Server:

- Windows 2000 Server
- Apache 2.0.48
- PHP 4.3.6
- XMail 1.18

Before recovering XMail I was running IIS HTTP and IIS SMTP Server on the machine (but had Apache installed long before) and sending mails with PHP mail () was no problem there.

What can I do?

I already searched around and read related topics, but found no solution. Configuration seems to be OK since all other things work well and I don't want to use the SMTP-class hschneider provided in one posting, because there are several things hosted on the server which just cannot be changed since they do not belong to us.

Thanks in advance,

Mario
PMEmail Poster
Top
hschneider
Posted: Apr 28 2004, 09:03 PM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02





--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
Nuclear-Ping
Posted: Apr 28 2004, 11:57 PM
Quote Post


Newbie
*

Group: Members
Posts: 21
Member No.: 1087
Joined: 28-April 04



Hi and thanks! smile.gif

Yes, I already did. Thats why I said "... I don't want to use the SMTP-class hschneider provided in one posting ..."

Sorry, but this thread was no solution for me, since I cannot just replace existing codes which are owned by customers with the SMTP-Class.

Isn't there a plain solution just without using 3rd Party PHP Code? I mean, using IIS' SMTP worked without any problems providing localhost as SMTP Server in the PHP.INI. It also must / should be possible with XMail, shouldn't it?

Greetings,
Mario
PMEmail Poster
Top
hschneider
Posted: Apr 29 2004, 07:09 AM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



Sorry - been reading too fast ..

Can you post me some example script + your php.ini ?


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
hschneider
Posted: Apr 29 2004, 07:27 AM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



Just checked it out on my machine (WinXP + XMail 1.18 + PHP4.3.4): works without any problems.

Make sure that 'sendmail_from' is set to a valid value in your PHP.ini. It's default is postmaster@localhost, which is rejected by most recipient servers, because RDNS lookups fail.

Further pls make sure, that the machine on which your script is executed, is allowed to relay without SMTP auth. This requires an entry in smtprelay.tab. Have again a look at your php.ini. If SMTP is e.g. set to localhost, you need to add
"127.0.0.0" "255.255.255.0"
to your smtprelay.tab

Here is my example script:

CODE

<?php
 mail('test@marketmix.com','Test','Just a test');
?>


You can also force sendmail_from directly from your script:

CODE

<?php
 ini_set('sendmail_from','sender@marketmix.com');
 mail('test@marketmix.com','Test','Just a test');
?>


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
Nuclear-Ping
Posted: Apr 29 2004, 09:16 AM
Quote Post


Newbie
*

Group: Members
Posts: 21
Member No.: 1087
Joined: 28-April 04



OK, lol, my fault. wacko.gif

Now it works.

The error was:

in PHP.ini

- SMTP was not set to localhost but to the inet hostname of server, I changed it when trying to find the error
- send_from was not set to a valid host (fictive host), because IIS didn't care about this (wasn't configured to)

in smtprelay.tab:

I once tryed this combination, but with "127.0.0.1"[TAB]"255.255.255.0"[RETURN], but that didn't work, because PHP was still not configured correctly.

Now I set SMTP to localhost and send_from to postmaster@ourdomain.tld in PHP.ini, smtprelay.tab to "127.0.0.0"[TAB]"255.255.255.0"[RETURN], restarted all the stuff and now it works! smile.gif

Thanks alot for the help. smile.gif

Greetings,
Mario
PMEmail Poster
Top
hschneider
Posted: Apr 29 2004, 09:18 AM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



Fine! Your're welcome ... cool.gif


---------------------------------------------------------

Additional info:

Make sure, you call mail() like this:

CODE

mail('recipient@domain.com','your_subject',$body,$HEADERS,"-f$FROM");


where $FROM holds the address which should appear in the envelope.
$HEADERS can hold additional headers or can be empty.


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Documentation and Knowledge Base | Next Newest »

Closed TopicStart new topicStart Poll