Hello
I’m using a Windows Server as a testing environment and I was just testing the "Contact us" form that uses eForm and comes with the default installation. The code is this:
[!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[(email_sender)]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`ContactStyles` &gotoid=`46` !]
The form seems to work fine, it redirects to the "Thank you" page, BUT the mail never arrives. So I changed the
&to parameter to this:
&to=`[email protected]` and now I get the following error after submitting the form:
PHP error debug
Error: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address
Error type/ Nr.: Warning - 2
File: F:\McWebSites\metrotec\manager\includes\controls\class.phpmailer.php
Line: 438
Line 438 source: $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
It’s very strange, because I know the PHP mail() function is working correctly. I verified it by using the
Forgot Password option; the new password activation message always arrives instantly.
I believe this a
headers format problem on windows. The
Forgot Password option uses the
WebLogin snippet and the file
weblogin.common.inc.php. Inside this file, the code that sends email works fine (look at the headers format):
if(!mail($email, $emailsubject, $message, "From: ".$emailsender."\r\n"."X-Mailer: Content Manager - PHP/".phpversion())) {
return webLoginAlert("Error while sending mail to $mailto",1);
}
With
eForm, the code that sends email is located on file
class.phpmailer.php and it looks like this:
$rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
It’s just a guess, but I think this header has a format that the
mail() function is rejecting.
Any suggestions / ideas will be greatly appreciated.
Mc