No mail function at all

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Willy92
Posts: 8
Joined: Thu Feb 04, 2010 7:27 am

No mail function at all

Post by Willy92 »

I have 2.6.2 installed on a Windows server = Apache PHP MySql
PHP mail command works on sites using other systems - forum, online store etc - all use php mail command

the faq does not send any mail out - I have checked the smpt log in my mailserver - it shows the mail incoming - but there is no from field, the size is 1kb and there is no content. So to sum it up the FAQ makes contact with the smpt service on the mail server - but sends no data from date subject body etc are all missing. Safe mode is off in PHP Sendmail is not on this server, but smtp is set up and working. The mail command works. Suggestions??
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No mail function at all

Post by Thorsten »

Hi,

did you entered an email address in the configuration?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Willy92
Posts: 8
Joined: Thu Feb 04, 2010 7:27 am

Re: No mail function at all

Post by Willy92 »

Yes I did - I'm not exactly new to this. I can post the following code in the server and sucessfully send mail:
<?php
// Send to?
$to = "XXXXX@XXX.ca";

// The Subject
$subject = "Email Test";

// The message
$message = "This is a test.\n
How much is Linux worth today?\n
End of email message!";

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);

// Send email
// Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.
// Use if command to display email message status
if ( mail($to, $subject, $message) )
{
echo("Your email message successfully sent.");
}
else
{
echo("Sorry, message delivery failed. Contact webmaster for more info.");
}
?>

It appears that the FAQ is misassembling the email - It sends the mail server into a loop that has to be cut off by the bounce control. The to and from appear to be scrambled, and thus the loop starts. It does, as per previously post, connect to the mail server, but the data is not assembled properly. I have gone through the config, and also scanned through the database tables - everything appears right . Suggestions - I need to be able to have the contact form work - and of course the sighup emails etc
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No mail function at all

Post by Thorsten »

Hi,

did you entered an email address in the configuration?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Willy92
Posts: 8
Joined: Thu Feb 04, 2010 7:27 am

Re: No mail function at all

Post by Willy92 »

Yes I did - I'm not exactly new to this.
Again - Yes I did

Did you read the previous post - The issue is NOT that its not sending mail - its that the mail being sent is not assembled properly.

EDIT - After spending about 6 hours on this - the issue seems to be the mail server is rejecting all mail from PHPMYFAQ Because there is no from content being put into the emails - they appear from blank - and that should not happen.....
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No mail function at all

Post by Thorsten »

Hi,

I'll check the code in the Mail class.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No mail function at all

Post by Thorsten »

Hi,

looks good for me:

Code: Select all

Received: from [80.67.18.2] (helo=mx02.ispgateway.de)
	by hegoa.ispgateway.de with esmtp (Exim 4.68)
	(envelope-from <xxx@phpmyfaq.de>)
	id 1NdISe-0004gm-UV; Fri, 05 Feb 2010 08:18:40 +0100
Return-path: <xxx@phpmyfaq.de>
X-Envelope-To: xxx@phpmyfaq.de
Received: from [88.217.134.114] (helo=univac.mf-muc.nop)
	by mx02.ispgateway.de with esmtp (Exim 4.68)
	(envelope-from <xxx@phpmyfaq.de>)
	id 1NdISe-00082K-SM
	for xxx@phpmyfaq.de; Fri, 05 Feb 2010 08:18:40 +0100
Received: by univac.mf-muc.nop (Postfix, from userid 70)
	id C01222A0B58; Fri,  5 Feb 2010 08:18:39 +0100 (CET)
To: <xxx@phpmyfaq.de>
Subject: Feedback: phpMyFAQ Codename Portia
X-PHP-Originating-Script: 501:Builtin.php
Content-Disposition: inline
Content-Type: text/plain; format=flowed; charset="utf-8"
Content-Transfer-Encoding: 7bit
Date: Fri, 05 Feb 2010 08:18:38 +0100
From: Thorsten Rinne <xxx@phpmyfaq.de>
Message-ID: <1265354318.6e46e3ee3f4acace767abd454fa6a883@localhost>
MIME-Version: 1.0
Reply-To: Thorsten Rinne <xxx@phpmyfaq.de>
Sender: Thorsten Rinne <xxx@phpmyfaq.de>
X-Mailer: phpMyFAQ/2.6.3
X-MSMail-Priority: Normal
X-Originating-IP: ::1
X-Priority: 3
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	spamfilter01.ispgateway.de
X-Spam-Level: 
X-Spam-Status: No, hits=-1.9 required=9999.0 tests=BAYES_20 autolearn=disabled
	version=3.2.5
X-Spam-CMAETAG: v=1.1 cv=ENImooahNo34/wMOE8aecNwbHT/fB95vJS7uTvCTcQc=
	c=1 sm=0 a=tcGJIx6s20gA:10 a=S+lIQRlYq54CZpdZFLQaZQ==:17
	a=WM9UH6A7CZwljCZFPOQA:9 a=fT7vISkvBCZvyRSFVgCJ7XWLBBYA:4
	a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 xcat=Undefined/Undefined
X-Spam-CMAECATEGORY: 0
X-Spam-CMAESUBCATEGORY: 0
X-Spam-CMAESCORE: 0
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No mail function at all

Post by Thorsten »

phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Willy92
Posts: 8
Joined: Thu Feb 04, 2010 7:27 am

Re: No mail function at all

Post by Willy92 »

Thanks - The second link you posted can be edited into mail.php - and it stops the form from working at all - the first link - which is cleanup and bug fixes - the code in my mail.php is not the same as what you say to change - you have me taking out lines that don't exist in my mail.php.

How about just posting me the proper fixed code for the whole file mail.php so I can replace the file.
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No mail function at all

Post by Thorsten »

HI,

I checked it two more times and this file is working now: http://github.com/thorsten/phpMyFAQ/blo ... c/Mail.php

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No mail function at all

Post by Thorsten »

HI,

I improved the last fix. This works on various systems.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Willy92
Posts: 8
Joined: Thu Feb 04, 2010 7:27 am

Re: No mail function at all

Post by Willy92 »

Sorry to be such a pain, but I still can not send mail from the contact form, the mail from suggest a question, register etc does not go.

We have tested this against 4 different mail systems, pop3 and webmail. Every server rejects the mail because the header is illegal. It does not contain the from, and other required formatting. The servers get the mail transaction, then delete it rather than deliver it as it is non standard.

This is not just our servers,but numerous others also. I have phpbb3, directories, galleries, online stores etc hosted for clients and this is the only package that we can not use the mail function on.

The post you directed me to to get the mail.php file indicated it is for 2.6.1 not 2.6.2 - is this an issue. We would love to get this to work - we have a domain configured and are building content - but without mail we will end up having to scrap it - so any help you cn give would be appreciated.
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No mail function at all

Post by Thorsten »

HI,

the link above is the current pre 2.6.3 version. We introduced an issue in 2.6.2. We fixed that now. What's incorrect in the mail header? Where do you have no From: header?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Willy92
Posts: 8
Joined: Thu Feb 04, 2010 7:27 am

Re: No mail function at all

Post by Willy92 »

Appreciate all the time you are spending - for info sake I am using the 2.6.2 downloaded about 5 days ago

I have done this - I was able to get the message through to an isp mail account - played in config using a ton of different emails
When it came through there was no from entry in the header at all - not from blank - but no from at all. (As most of the mail servers I encounter require that there to be a from in the header or they delete the mail, the majority of addresses I tried to send it to just killed it.) As a temp fix I was able to force php to add a from and my admin address to the outgoing mail from the mail() function. As this is a windows based server, I was also able to mod the sendmail function also - and it is set to force a from header. The FAQ will now send mail sucessfully, with the exception that I do not really know who its from. It appears from the code of your contact form that you add the name given and the email address given together - and deposit that result into the hearer for from. But on my install it does not happen - the from header section is never generated at all - so when the server outgoing mail function contacts the mail server, the port is right, it gets the server id - it gets recipient, but no from - that data is not in the stream. Also - before I forced the from into the stream at the server - the content of the message would pass as null - but when the from is forced, the message content appears.

Hopefully this is some help. I have put the faq into realtime use as it was a time sensitive need - and it is working with the following exceptions

1 Mail as above
2 The admin worklog is empty/not accessable - it appears as a title on the administration page - but there is nothing there.
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No mail function at all

Post by Thorsten »

Hi,

please use the Mail.php class from above and the empty header will be fixed. The admin worklog is filled if you e.g. use a ajax powered function in the admin backend.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply